Merge "Tokenizer: don't strip backslashes from \x"

This commit is contained in:
jenkins-bot 2019-11-22 13:36:49 +00:00 committed by Gerrit Code Review
commit 2d2e524dca
2 changed files with 8 additions and 3 deletions

View file

@ -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:

View file

@ -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}]'