From 85dbbe19e20999a59cbc6707ba524c8055c5d271 Mon Sep 17 00:00:00 2001 From: Niels Dossche <7771979+nielsdos@users.noreply.github.com> Date: Wed, 3 Jan 2024 20:23:56 +0100 Subject: [PATCH] Fix #71465: PHAR doesn't know about litespeed We should perhaps look into a generic system to ask the SAPI whether a feature should be supported or not. Or, we should look into making a denylist instead of an allowlist. Anyway, let's not try doing anything fancy on stable branches. Closes GH-13070. --- NEWS | 2 ++ ext/phar/phar_object.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 3a6f1b7ce0d..881c079f29a 100644 --- a/NEWS +++ b/NEWS @@ -2,6 +2,8 @@ PHP NEWS ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 8.2.16 +- Phar: + . Fixed bug #71465 (PHAR doesn't know about litespeed). (nielsdos) 18 Jan 2024, PHP 8.2.15 diff --git a/ext/phar/phar_object.c b/ext/phar/phar_object.c index 8cd13e7282b..646cf42c4a9 100644 --- a/ext/phar/phar_object.c +++ b/ext/phar/phar_object.c @@ -599,7 +599,8 @@ PHP_METHOD(Phar, webPhar) if ((sapi_mod_name_len == sizeof("cgi-fcgi") - 1 && !strncmp(sapi_module.name, "cgi-fcgi", sizeof("cgi-fcgi") - 1)) || (sapi_mod_name_len == sizeof("fpm-fcgi") - 1 && !strncmp(sapi_module.name, "fpm-fcgi", sizeof("fpm-fcgi") - 1)) - || (sapi_mod_name_len == sizeof("cgi") - 1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi") - 1))) { + || (sapi_mod_name_len == sizeof("cgi") - 1 && !strncmp(sapi_module.name, "cgi", sizeof("cgi") - 1)) + || (sapi_mod_name_len == sizeof("litespeed") - 1 && !strncmp(sapi_module.name, "litespeed", sizeof("litespeed") - 1))) { if (Z_TYPE(PG(http_globals)[TRACK_VARS_SERVER]) != IS_UNDEF) { HashTable *_server = Z_ARRVAL(PG(http_globals)[TRACK_VARS_SERVER]);