diff --git a/CHANGELOG.md b/CHANGELOG.md index 85b7392c..c3d18917 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,7 +18,7 @@ Please also have a look at our ### Fixed -- Use typesafe versions of PHP functions (#1379, #1380) +- Use typesafe versions of PHP functions (#1379, #1380, #1382) ### Documentation diff --git a/src/Value/CSSString.php b/src/Value/CSSString.php index 8c4cf656..569311d7 100644 --- a/src/Value/CSSString.php +++ b/src/Value/CSSString.php @@ -10,6 +10,8 @@ use Sabberworm\CSS\Parsing\UnexpectedEOFException; use Sabberworm\CSS\Parsing\UnexpectedTokenException; +use function Safe\preg_match; + /** * This class is a wrapper for quoted strings to distinguish them from keywords. * @@ -54,7 +56,7 @@ public static function parse(ParserState $parserState): CSSString $content = null; if ($quote === null) { // Unquoted strings end in whitespace or with braces, brackets, parentheses - while (\preg_match('/[\\s{}()<>\\[\\]]/isu', $parserState->peek()) !== 1) { + while (preg_match('/[\\s{}()<>\\[\\]]/isu', $parserState->peek()) === 0) { $result .= $parserState->parseCharacter(false); } } else {