Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ Please also have a look at our

### Fixed

- Use typesafe versions of PHP functions (#1379)

### Documentation

## 9.1.0: Add support for PHP 8.5
Expand Down
6 changes: 5 additions & 1 deletion src/Value/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
use Sabberworm\CSS\Position\Position;
use Sabberworm\CSS\Position\Positionable;

use function Safe\preg_match;

/**
* Abstract base class for specific classes of CSS values: `Size`, `Color`, `CSSString` and `URL`, and another
* abstract subclass `ValueList`.
Expand Down Expand Up @@ -204,7 +206,9 @@ private static function parseUnicodeRangeValue(ParserState $parserState): string
$codepointMaxLength = 13; // Max length is 2 six-digit code points + the dash(-) between them
}
$range .= $parserState->consume(1);
} while (\strlen($range) < $codepointMaxLength && \preg_match('/[A-Fa-f0-9\\?-]/', $parserState->peek()));
} while (
(\strlen($range) < $codepointMaxLength) && (preg_match('/[A-Fa-f0-9\\?-]/', $parserState->peek()) === 1)
);

return "U+{$range}";
}
Expand Down