Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 1ff776d

Browse files
committedFeb 22, 2025·
fix php 7.2
1 parent dd036c1 commit 1ff776d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

‎src/Rules/Regexp/RegularExpressionPatternRule.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function validatePattern(string $pattern): ?string
128128
try {
129129
Strings::match('', $pattern);
130130
} catch (RegexpException $e) {
131-
if (str_contains($e->getMessage(), 'UTF-8 error')) {
131+
if (str_contains($e->getMessage(), 'Compilation failed') && str_contains($e->getMessage(), 'UTF-8')) {
132132
$patternPos = strpos($e->getMessage(), 'pattern:');
133133
if ($patternPos === false) {
134134
throw new ShouldNotHappenException();

0 commit comments

Comments
 (0)
Please sign in to comment.