mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-23 13:46:48 +00:00
Tokenizer: don't strip backslashes from \x
Bug: T238475 Change-Id: I8c2ea6ad369946df93440eece60d456dc1a3fd7a
This commit is contained in:
parent
a0b349d4c3
commit
c73381b6db
|
@ -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