Skip to content

Commit 3bc7e7f

Browse files
authored
[BUGFIX] Use safe preg functions in Rule (#1383)
Part of #1168
1 parent 6bfa357 commit 3bc7e7f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Please also have a look at our
1818

1919
### Fixed
2020

21-
- Use typesafe versions of PHP functions (#1379, #1380, #1382)
21+
- Use typesafe versions of PHP functions (#1379, #1380, #1382, #1383)
2222

2323
### Documentation
2424

src/Rule/Rule.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
use Sabberworm\CSS\Value\RuleValueList;
1818
use Sabberworm\CSS\Value\Value;
1919

20+
use function Safe\preg_match;
21+
2022
/**
2123
* `Rule`s just have a string key (the rule) and a 'Value'.
2224
*
@@ -100,7 +102,7 @@ public static function parse(ParserState $parserState, array $commentsBeforeRule
100102
*/
101103
private static function listDelimiterForRule(string $rule): array
102104
{
103-
if (\preg_match('/^font($|-)/', $rule)) {
105+
if (preg_match('/^font($|-)/', $rule) === 1) {
104106
return [',', '/', ' '];
105107
}
106108

0 commit comments

Comments
 (0)