PHP-CSS-Parser icon indicating copy to clipboard operation
PHP-CSS-Parser copied to clipboard

Inconsistent behaviour of Value::parseValue with odd vs even number of consecutive delimiters

Open JakeQZ opened this issue 1 year ago • 2 comments

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.

JakeQZ avatar Jun 27 '24 23:06 JakeQZ

That's very strange (and unfruity) indeed …

oliverklee avatar Jun 28 '24 07:06 oliverklee

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

oliverklee avatar Jun 28 '24 07:06 oliverklee