PHP-CSS-Parser
PHP-CSS-Parser copied to clipboard
Inconsistent behaviour of Value::parseValue with odd vs even number of consecutive delimiters
Initial investigation arises from the infinite loop fix in #390, which it turns out was fixed separately by #413.
I tried throwing the following at Value::parseValue:
/!;//!;///!;////!;
The 1st and 3rd seemed fine, resulting in / and /// respectively. The 2nd and 4th resulted in UnexpectedTokenException: Identifier expected. Got “!;”.
In terms of the metaphor "low-hanging-fruit", this isn't even fruit. I am just logging this so the information is captured, and that we can be mindful of the curious behaviour when revisiting that area of the code.
That's very strange (and unfruity) indeed …
Nikita Popov also reported some strange behavior he encountered using fuzzing. We'll want to check those some time (preferably after the 9.0 release - I'd like to do some big cleanups for 10.0): https://github.com/MyIntervals/PHP-CSS-Parser/issues/created_by/nikic