You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit c5d9ab6
Browse filesBrowse the repository at this point in the historyBrowse files
Make WP_MySQL_Token::get_value() binary-safe for string literals
The final backslash-stripping step used preg_replace() with the "u" (UTF-8)
modifier. That modifier makes PCRE validate the whole subject as UTF-8 and
return null on the first invalid byte; since get_value() is typed ": string",
the null turned into a fatal TypeError. MySQL string literals may legitimately
carry non-UTF-8 bytes (binary or other-charset payloads), and the lexer scans
them at the byte level, so reading the value of such a literal crashed.
Switch the modifier to "s" (DOTALL). A byte-wise strip is binary-safe, yields
identical results for valid UTF-8 (no continuation byte is a backslash), and
additionally handles a backslash preceding a newline byte.
0 commit comments