8000 bug #54080 [Routing] Enhance error handling in StaticPrefixCollection… · symfony/symfony@dc1da9c · GitHub
[go: up one dir, main page]

Skip to content

Commit dc1da9c

Browse files
committed
bug #54080 [Routing] Enhance error handling in StaticPrefixCollection for compatibility with libpcre2-10.43 (Lustmored)
This PR was merged into the 5.4 branch. Discussion ---------- [Routing] Enhance error handling in StaticPrefixCollection for compatibility with libpcre2-10.43 The error handling function in the StaticPrefixCollection class has been extended. A new check for 'Compilation failed: length of lookbehind assertion is not limited' message error was added to improve the error capture process. | Q | A | ------------- | --- | Branch? | 5.4 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | Fix #54067 | License | MIT Recent changes in libpcre2 have changed the error message we are trying to catch in StaticPrefixCollection. The change comes from this commit (please take a look at changes in `src/pcre2_error.c`): PCRE2Project/pcre2@1e78b77 This PR checks for both possible error messages for backwards-compatible way of handling errors. I did not add any tests as current tests are throwing PHP warnings when run with newer libpcre2, which are gone after the proposed change and I'm unsure how to proceed with that fact. Commits ------- 7183330 Enhance error handling in StaticPrefixCollection for compatibility with libpcre2-10.43
2 parents 6a229c7 + 7183330 commit dc1da9c

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/Symfony/Component/Routing/Matcher/Dumper/StaticPrefixCollection.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,7 @@ private function getCommonPrefix(string $prefix, string $anotherPrefix): array
200200

201201
public static function handleError(int $type, string $msg)
202202
{
203-
return str_contains($msg, 'Compilation failed: lookbehind assertion is not fixed length');
203+
return str_contains($msg, 'Compilation failed: lookbehind assertion is not fixed length')
204+
|| str_contains($msg, 'Compilation failed: length of lookbehind assertion is not limited');
204205
}
205206
}

0 commit comments

Comments
 (0)
0