From 8e1cef43414c41fec033596072290c855c79029c Mon Sep 17 00:00:00 2001 From: Jakub Zelenka Date: Thu, 29 Sep 2022 15:24:09 +0100 Subject: [PATCH] Do not check X-Powered-By header in FPM tester if expose_php off Closes GH-9508 --- sapi/fpm/tests/response.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sapi/fpm/tests/response.inc b/sapi/fpm/tests/response.inc index 4d462132b94..9112da6ed77 100644 --- a/sapi/fpm/tests/response.inc +++ b/sapi/fpm/tests/response.inc @@ -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) ); }