Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b92d944

Browse files
bug #33863 [Routing] gracefully handle docref_root ini setting (nicolas-grekas)
This PR was merged into the 4.3 branch. Discussion ---------- [Routing] gracefully handle docref_root ini setting | Q | A | ------------- | --- | Branch? | 4.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #33833 | License | MIT | Doc PR | - Commits ------- 4d5530f [Routing] gracefully handle docref_root ini setting
2 parents 2e92ffe + 4d5530f commit b92d944

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public function getCompiledRoutes(bool $forDump = false): array
9191

9292
while (true) {
9393
try {
94-
$this->signalingException = new \RuntimeException('preg_match(): Compilation failed: regular expression is too large');
94+
$this->signalingException = new \RuntimeException('Compilation failed: regular expression is too large');
9595
$compiledRoutes = array_merge($compiledRoutes, $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit, $conditions));
9696

9797
break;
@@ -349,7 +349,7 @@ private function compileDynamicRoutes(RouteCollection $collection, bool $matchHo
349349
$state->markTail = 0;
350350

351351
// if the regex is too large, throw a signaling exception to recompute with smaller chunk size
352-
set_error_handler(function ($type, $message) { throw 0 === strpos($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); });
352+
set_error_handler(function ($type, $message) { throw false !== strpos($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); });
353353
try {
354354
preg_match($state->regex, '');
355355
} finally {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,6 @@ private function getCommonPrefix(string $prefix, string $anotherPrefix): array
197197

198198
public static function handleError($type, $msg)
199199
{
200-
return 0 === strpos($msg, 'preg_match(): Compilation failed: lookbehind assertion is not fixed length');
200+
return false !== strpos($msg, 'Compilation failed: lookbehind assertion is not fixed length');
201201
}
202202
}

0 commit comments

Comments
 (0)