Skip to content

Commit b889ec4

Browse files
committed
Merge branch 'PHP-8.5'
* PHP-8.5: Add missing NEWS entry for FPM phpGH-19817 fix Fix phpGH-19817: Decode SCRIPT_FILENAME issue in php 8.5 (php#20114)
2 parents baa5319 + d8a7018 commit b889ec4

File tree

5 files changed

+12
-12
lines changed

5 files changed

+12
-12
lines changed

php.ini-development

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -807,10 +807,10 @@ enable_dl = Off
807807
;fastcgi.impersonate = 1
808808

809809
; Prevent decoding of SCRIPT_FILENAME when using Apache ProxyPass or
810-
; ProxyPassMatch. This should only be used if script file paths are already
811-
; stored in an encoded format on the file system.
812-
; Default is 0.
813-
;fastcgi.script_path_encoded = 1
810+
; ProxyPassMatch. This should be used if script file paths are not stored
811+
; in an encoded format on the file system.
812+
; Default is 1.
813+
;fastcgi.script_path_encoded = 0
814814

815815
; Disable logging through FastCGI connection. PHP's default behavior is to enable
816816
; this feature.

php.ini-production

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -809,10 +809,10 @@ enable_dl = Off
809809
;fastcgi.impersonate = 1
810810

811811
; Prevent decoding of SCRIPT_FILENAME when using Apache ProxyPass or
812-
; ProxyPassMatch. This should only be used if script file paths are already
813-
; stored in an encoded format on the file system.
814-
; Default is 0.
815-
;fastcgi.script_path_encoded = 1
812+
; ProxyPassMatch. This should be used if script file paths are not stored
813+
; in an encoded format on the file system.
814+
; Default is 1.
815+
;fastcgi.script_path_encoded = 0
816816

817817
; Disable logging through FastCGI connection. PHP's default behavior is to enable
818818
; this feature.

sapi/fpm/fpm/fpm_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1435,7 +1435,7 @@ PHP_INI_BEGIN()
14351435
STD_PHP_INI_BOOLEAN("cgi.nph", "0", PHP_INI_ALL, OnUpdateBool, nph, php_cgi_globals_struct, php_cgi_globals)
14361436
STD_PHP_INI_BOOLEAN("cgi.fix_pathinfo", "1", PHP_INI_SYSTEM, OnUpdateBool, fix_pathinfo, php_cgi_globals_struct, php_cgi_globals)
14371437
STD_PHP_INI_BOOLEAN("cgi.discard_path", "0", PHP_INI_SYSTEM, OnUpdateBool, discard_path, php_cgi_globals_struct, php_cgi_globals)
1438-
STD_PHP_INI_BOOLEAN("fastcgi.script_path_encoded", "0", PHP_INI_SYSTEM, OnUpdateBool, fcgi_script_path_encoded, php_cgi_globals_struct, php_cgi_globals)
1438+
STD_PHP_INI_BOOLEAN("fastcgi.script_path_encoded", "1", PHP_INI_SYSTEM, OnUpdateBool, fcgi_script_path_encoded, php_cgi_globals_struct, php_cgi_globals)
14391439
STD_PHP_INI_BOOLEAN("fastcgi.logging", "1", PHP_INI_SYSTEM, OnUpdateBool, fcgi_logging, php_cgi_globals_struct, php_cgi_globals)
14401440
STD_PHP_INI_ENTRY("fastcgi.error_header", NULL, PHP_INI_SYSTEM, OnUpdateString, error_header, php_cgi_globals_struct, php_cgi_globals)
14411441
STD_PHP_INI_ENTRY("fpm.config", NULL, PHP_INI_SYSTEM, OnUpdateString, fpm_config, php_cgi_globals_struct, php_cgi_globals)
@@ -1448,7 +1448,7 @@ static void php_cgi_globals_ctor(php_cgi_globals_struct *php_cgi_globals)
14481448
php_cgi_globals->nph = 0;
14491449
php_cgi_globals->fix_pathinfo = 1;
14501450
php_cgi_globals->discard_path = 0;
1451-
php_cgi_globals->fcgi_script_path_encoded = 0;
1451+
php_cgi_globals->fcgi_script_path_encoded = 1;
14521452
php_cgi_globals->fcgi_logging = 1;
14531453
php_cgi_globals->fcgi_logging_request_started = false;
14541454
zend_hash_init(&php_cgi_globals->user_config_cache, 0, NULL, user_config_cache_entry_dtor, 1);

sapi/fpm/tests/fcgi-env-pif-apache-pp-sfp-decoding.phpt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ pm.start_servers = 1
1818
pm.min_spare_servers = 1
1919
pm.max_spare_servers = 3
2020
php_admin_value[cgi.fix_pathinfo] = yes
21+
php_admin_value[fastcgi.script_path_encoded] = no
2122
EOT;
2223

2324
$code = <<<EOT

sapi/fpm/tests/fcgi-env-pif-apache-pp-sfp-encoded.phpt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
--TEST--
2-
FPM: FastCGI change for Apache ProxyPass SCRIPT_FILENAME decoding - fallback (GH-17645)
2+
FPM: FastCGI change for Apache ProxyPass SCRIPT_FILENAME decoding - default (GH-17645)
33
--SKIPIF--
44
<?php include "skipif.inc"; ?>
55
--FILE--
@@ -18,7 +18,6 @@ pm.start_servers = 1
1818
pm.min_spare_servers = 1
1919
pm.max_spare_servers = 3
2020
php_admin_value[cgi.fix_pathinfo] = yes
21-
php_admin_value[fastcgi.script_path_encoded] = yes
2221
EOT;
2322

2423
$code = <<<EOT

0 commit comments

Comments
 (0)