Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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, #1381)

### Documentation

Expand Down
4 changes: 3 additions & 1 deletion src/Value/CSSString.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.
*
Expand Down Expand Up @@ -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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agree === 0 is clearer, now that we can test like that.

$result .= $parserState->parseCharacter(false);
}
} else {
Expand Down