mirror of
https://github.com/Combodo/iTop.git
synced 2026-05-19 23:32:17 +02:00
N°8834 - Add compatibility with PHP 8.4 (#819)
* N°8834 - Add compatibility with PHP 8.4 * Rollback of scssphp/scssphp version upgrade due to compilation error
This commit is contained in:
@@ -42,7 +42,7 @@ trait CompiledUrlMatcherTrait
|
||||
throw new MethodNotAllowedException(array_keys($allow));
|
||||
}
|
||||
if (!$this instanceof RedirectableUrlMatcherInterface) {
|
||||
throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
|
||||
throw new ResourceNotFoundException(\sprintf('No routes found for "%s".', $pathinfo));
|
||||
}
|
||||
if (!\in_array($this->context->getMethod(), ['HEAD', 'GET'], true)) {
|
||||
// no-op
|
||||
@@ -57,7 +57,7 @@ trait CompiledUrlMatcherTrait
|
||||
} finally {
|
||||
$this->context->setScheme($scheme);
|
||||
}
|
||||
} elseif ('/' !== $trimmedPathinfo = rtrim($pathinfo, '/') ?: '/') {
|
||||
} elseif ('' !== $trimmedPathinfo = rtrim($pathinfo, '/')) {
|
||||
$pathinfo = $trimmedPathinfo === $pathinfo ? $pathinfo.'/' : $trimmedPathinfo;
|
||||
if ($ret = $this->doMatch($pathinfo, $allow, $allowSchemes)) {
|
||||
return $this->redirect($pathinfo, $ret['_route']) + $ret;
|
||||
@@ -67,14 +67,14 @@ trait CompiledUrlMatcherTrait
|
||||
}
|
||||
}
|
||||
|
||||
throw new ResourceNotFoundException(sprintf('No routes found for "%s".', $pathinfo));
|
||||
throw new ResourceNotFoundException(\sprintf('No routes found for "%s".', $pathinfo));
|
||||
}
|
||||
|
||||
private function doMatch(string $pathinfo, array &$allow = [], array &$allowSchemes = []): array
|
||||
{
|
||||
$allow = $allowSchemes = [];
|
||||
$pathinfo = rawurldecode($pathinfo) ?: '/';
|
||||
$trimmedPathinfo = rtrim($pathinfo, '/') ?: '/';
|
||||
$pathinfo = '' === ($pathinfo = rawurldecode($pathinfo)) ? '/' : $pathinfo;
|
||||
$trimmedPathinfo = '' === ($trimmedPathinfo = rtrim($pathinfo, '/')) ? '/' : $trimmedPathinfo;
|
||||
$context = $this->context;
|
||||
$requestMethod = $canonicalMethod = $context->getMethod();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user