Steffen
Well-known member
- Affected version
- 2.0.2
Quote tags with usernames that contain square brackets are not rewritten by the "rewriteQuotes" method. Example:
The code currently uses a single regex:
One solution would be to use two regexes:
The first regex allows usernames with square brackets if the argument is surrounded by quotes. The second regex handles cases without quotes.
Code:
[QUOTE='User [Name];123']Foo[/QUOTE]
The code currently uses a single regex:
Code:
'/\[quote=("|\'|)(?P<username>[^;\n\]]*);\s*n?(?P<postid>\d+)\s*\1\]/siU'
One solution would be to use two regexes:
Code:
'/\[quote=("|\')(?P<username>[^;\n]*);\s*n?(?P<postid>\d+)\s*\1\]/siU'
'/\[quote=(?P<username>[^;\n\]]*);\s*n?(?P<postid>\d+)\s*\]/siU'
The first regex allows usernames with square brackets if the argument is surrounded by quotes. The second regex handles cases without quotes.