-
Notifications
You must be signed in to change notification settings - Fork 16
CSS Processor string token values mishandle backslash-EOF #223
Copy link
Copy link
Open
Description
In CSS <string> token values, WordPress\DataLiberation\CSS\CSSProcessor::get_token_value() reports an incorrect token value when \ is at the end of input.
See the rules for consuming a string token:
Repeatedly consume the next input code point from the stream:
…
U+005C REVERSE SOLIDUS (
\)
- If the next input code point is EOF, do nothing.
…
Related to #222.
Demos
$p = WordPress\DataLiberation\CSS\CSSProcessor::create( "'string\\" );
$p->next_token();
assert( $p->get_token_type() === WordPress\DataLiberation\CSS\CSSProcessor::TOKEN_STRING );
assert( $p->get_token_value() === 'string', 'Expected "string", got ' . var_export( $p->get_token_value(), true ) );Will throw AssertionError: Expected "string", got 'string�'.
Example of string value equality
This should render with a fancy font, <i>not monospace</i>.
<style>
/* Note that the two "AB" strings match. */
body { font-family: 'AB', monospace;}
@font-face {
src: url(https://fonts.gstatic.com/s/lobster/v32/neILzCirqoswsqX9zoKmM4MwWJU.woff2) format('woff2');
font-family: 'AB\Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Fields
Give feedbackNo fields configured for issues without a type.