Skip to content

Commit 276dd01

Browse files
authored
[BUGFIX] Use the safe regexp functions in CSSList (#1368)
1 parent 64f524d commit 276dd01

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ Please also have a look at our
1818

1919
### Fixed
2020

21+
- Use typesafe versions of PHP functions (#1368)
22+
2123
### Documentation
2224

2325
## 9.0.0: New features, deprecation removals and bug fixes

src/CSSList/CSSList.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
use Sabberworm\CSS\Value\URL;
2626
use Sabberworm\CSS\Value\Value;
2727

28+
use function Safe\preg_match;
29+
2830
/**
2931
* This is the most generic container available. It can contain `DeclarationBlock`s (rule sets with a selector),
3032
* `RuleSet`s as well as other `CSSList` objects.
@@ -242,7 +244,7 @@ private static function identifierIs(string $identifier, string $match): bool
242244
return true;
243245
}
244246

245-
return \preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1;
247+
return preg_match("/^(-\\w+-)?$match$/i", $identifier) === 1;
246248
}
247249

248250
/**

0 commit comments

Comments
 (0)