diff --git a/phpBB/phpbb/textformatter/s9e/utils.php b/phpBB/phpbb/textformatter/s9e/utils.php index 40479b3423..b317fe4a8d 100644 --- a/phpBB/phpbb/textformatter/s9e/utils.php +++ b/phpBB/phpbb/textformatter/s9e/utils.php @@ -70,6 +70,12 @@ class utils implements \phpbb\textformatter\utils_interface $quote .= '=' . $this->format_attribute_value($attributes['author']); unset($attributes['author']); } + + if (isset($attributes['user_id']) && $attributes['user_id'] == ANONYMOUS) + { + unset($attributes['user_id']); + } + ksort($attributes); foreach ($attributes as $name => $value) { diff --git a/tests/text_formatter/s9e/utils_test.php b/tests/text_formatter/s9e/utils_test.php index 1c03783792..dade259790 100644 --- a/tests/text_formatter/s9e/utils_test.php +++ b/tests/text_formatter/s9e/utils_test.php @@ -175,6 +175,15 @@ class phpbb_textformatter_s9e_utils_test extends phpbb_test_case ), '[quote=user post_id=123 url=http://example.org]...[/quote]', ), + array( + '...', + array( + 'author' => 'user', + 'post_id' => 123, + 'user_id' => ANONYMOUS + ), + '[quote=user post_id=123]...[/quote]', + ), array( '...', array('author' => ' '),