diff --git a/includes/parser/AbuseFilterTokenizer.php b/includes/parser/AbuseFilterTokenizer.php index 81640bb6e..29f4fe08c 100644 --- a/includes/parser/AbuseFilterTokenizer.php +++ b/includes/parser/AbuseFilterTokenizer.php @@ -7,7 +7,7 @@ use Psr\Log\LoggerInterface; */ class AbuseFilterTokenizer { /** @var int Tokenizer cache version. Increment this when changing the syntax. **/ - const CACHE_VERSION = 2; + const CACHE_VERSION = 3; const COMMENT_START_RE = '/\s*\/\*/A'; const ID_SYMBOL_RE = '/[0-9A-Za-z_]+/A'; const OPERATOR_RE = @@ -307,7 +307,7 @@ class AbuseFilterTokenizer { // \xXX -- 2 done later $offset += 2; } else { - $token .= 'x'; + $token .= '\\x'; } break; default: diff --git a/tests/parserTests/string.t b/tests/parserTests/string.t index 47685ed92..d1467ef0f 100644 --- a/tests/parserTests/string.t +++ b/tests/parserTests/string.t @@ -3,4 +3,9 @@ "a\"b" === 'a"b' & "a\rb" !== "a\r\nb" & "\x66\x6f\x6f" === "foo" & -"some\xstring" === "somexstring" +"some\xstring" === "some\\xstring" & +"some\vstring" === "some\\vstring" & +/* T238475 */ +'\x{}' === '\x' + '{}' & +length('\x{}') === 4 & +'foobar' rlike '[\x{61}-\x{7a}]'