1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Do not check X-Powered-By header in FPM tester if expose_php off

Closes GH-9508
This commit is contained in:
Jakub Zelenka
2022-09-29 15:24:09 +01:00
parent 1ed4303957
commit 8e1cef4341

View File

@@ -102,7 +102,7 @@ class Response
/**
* Expect header in the response.
*
* @param string $name Header name.
* @param string $name Header name.
* @param string $value Header value.
*
* @return Response
@@ -226,7 +226,7 @@ class Response
{
// check default headers
return (
$this->checkHeader('X-Powered-By', '|^PHP/8|', true) &&
( ! ini_get('expose_php') || $this->checkHeader('X-Powered-By', '|^PHP/8|', true)) &&
$this->checkHeader('Content-type', '|^' . $contentType . '(;\s?charset=\w+)?|', true)
);
}