mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 14:13:54 +00:00
Merge "Tokenizer: don't strip backslashes from \x"
This commit is contained in:
commit
2d2e524dca
|
@ -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:
|
||||
|
|
|
@ -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}]'
|
||||
|
|
Loading…
Reference in a new issue