[Routing] gracefully handle docref_root ini setting
This commit is contained in:
parent
6016070132
commit
4d5530f8a4
@ -91,7 +91,7 @@ EOF;
|
|||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
$this->signalingException = new \RuntimeException('preg_match(): Compilation failed: regular expression is too large');
|
$this->signalingException = new \RuntimeException('Compilation failed: regular expression is too large');
|
||||||
$compiledRoutes = array_merge($compiledRoutes, $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit, $conditions));
|
$compiledRoutes = array_merge($compiledRoutes, $this->compileDynamicRoutes($dynamicRoutes, $matchHost, $chunkLimit, $conditions));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
@ -349,7 +349,7 @@ EOF;
|
|||||||
$state->markTail = 0;
|
$state->markTail = 0;
|
||||||
|
|
||||||
// if the regex is too large, throw a signaling exception to recompute with smaller chunk size
|
// if the regex is too large, throw a signaling exception to recompute with smaller chunk size
|
||||||
set_error_handler(function ($type, $message) { throw 0 === strpos($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); });
|
set_error_handler(function ($type, $message) { throw false !== strpos($message, $this->signalingException->getMessage()) ? $this->signalingException : new \ErrorException($message); });
|
||||||
try {
|
try {
|
||||||
preg_match($state->regex, '');
|
preg_match($state->regex, '');
|
||||||
} finally {
|
} finally {
|
||||||
|
@ -197,6 +197,6 @@ class StaticPrefixCollection
|
|||||||
|
|
||||||
public static function handleError($type, $msg)
|
public static function handleError($type, $msg)
|
||||||
{
|
{
|
||||||
return 0 === strpos($msg, 'preg_match(): Compilation failed: lookbehind assertion is not fixed length');
|
return false !== strpos($msg, 'Compilation failed: lookbehind assertion is not fixed length');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user