mirror of
https://github.com/Combodo/iTop.git
synced 2026-04-25 11:38:44 +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:
@@ -56,7 +56,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
return str_contains($value, sprintf('%s/1.0', strtoupper($this->getName())));
|
||||
return str_contains($value, \sprintf('%s/1.0', strtoupper($this->getName())));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
public function addSurrogateCapability(Request $request)
|
||||
{
|
||||
$current = $request->headers->get('Surrogate-Capability');
|
||||
$new = sprintf('symfony="%s/1.0"', strtoupper($this->getName()));
|
||||
$new = \sprintf('symfony="%s/1.0"', strtoupper($this->getName()));
|
||||
|
||||
$request->headers->set('Surrogate-Capability', $current ? $current.', '.$new : $new);
|
||||
}
|
||||
@@ -76,7 +76,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
$pattern = sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
|
||||
$pattern = \sprintf('#content="[^"]*%s/1.0[^"]*"#', strtoupper($this->getName()));
|
||||
|
||||
return (bool) preg_match($pattern, $control);
|
||||
}
|
||||
@@ -89,7 +89,7 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
$response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
|
||||
|
||||
if (!$response->isSuccessful() && Response::HTTP_NOT_MODIFIED !== $response->getStatusCode()) {
|
||||
throw new \RuntimeException(sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode()));
|
||||
throw new \RuntimeException(\sprintf('Error when rendering "%s" (Status code is %d).', $subRequest->getUri(), $response->getStatusCode()));
|
||||
}
|
||||
|
||||
return $response->getContent();
|
||||
@@ -120,12 +120,12 @@ abstract class AbstractSurrogate implements SurrogateInterface
|
||||
$value = $response->headers->get('Surrogate-Control');
|
||||
$upperName = strtoupper($this->getName());
|
||||
|
||||
if (sprintf('content="%s/1.0"', $upperName) == $value) {
|
||||
if (\sprintf('content="%s/1.0"', $upperName) == $value) {
|
||||
$response->headers->remove('Surrogate-Control');
|
||||
} elseif (preg_match(sprintf('#,\s*content="%s/1.0"#', $upperName), $value)) {
|
||||
$response->headers->set('Surrogate-Control', preg_replace(sprintf('#,\s*content="%s/1.0"#', $upperName), '', $value));
|
||||
} elseif (preg_match(sprintf('#content="%s/1.0",\s*#', $upperName), $value)) {
|
||||
$response->headers->set('Surrogate-Control', preg_replace(sprintf('#content="%s/1.0",\s*#', $upperName), '', $value));
|
||||
} elseif (preg_match(\sprintf('#,\s*content="%s/1.0"#', $upperName), $value)) {
|
||||
$response->headers->set('Surrogate-Control', preg_replace(\sprintf('#,\s*content="%s/1.0"#', $upperName), '', $value));
|
||||
} elseif (preg_match(\sprintf('#content="%s/1.0",\s*#', $upperName), $value)) {
|
||||
$response->headers->set('Surrogate-Control', preg_replace(\sprintf('#content="%s/1.0",\s*#', $upperName), '', $value));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user