mirror of
https://github.com/php/php-src.git
synced 2026-03-24 00:02:20 +01:00
Fix GH-17643: FPM with httpd ProxyPass encoded PATH_INFO env
Closes GH-17644
This commit is contained in:
4
NEWS
4
NEWS
@@ -14,6 +14,10 @@ PHP NEWS
|
||||
. Fixed bug GH-17718 (Calling static methods on an interface that has
|
||||
`__callStatic` is allowed). (timwolla)
|
||||
|
||||
- FPM:
|
||||
. Fixed bug GH-17643 (FPM with httpd ProxyPass encoded PATH_INFO env).
|
||||
(Jakub Zelenka)
|
||||
|
||||
- LDAP:
|
||||
. Fixed bug GH-17704 (ldap_search fails when $attributes contains a
|
||||
non-packed array with numerical keys). (nielsdos, 7u83)
|
||||
|
||||
@@ -1153,6 +1153,7 @@ static void init_request_info(void)
|
||||
}
|
||||
|
||||
if (tflag) {
|
||||
char *decoded_path_info = NULL;
|
||||
if (orig_path_info) {
|
||||
char old;
|
||||
|
||||
@@ -1174,7 +1175,6 @@ static void init_request_info(void)
|
||||
* As we can extract PATH_INFO from PATH_TRANSLATED
|
||||
* it is probably also in SCRIPT_NAME and need to be removed
|
||||
*/
|
||||
char *decoded_path_info = NULL;
|
||||
size_t decoded_path_info_len = 0;
|
||||
if (strchr(path_info, '%')) {
|
||||
decoded_path_info = estrdup(path_info);
|
||||
@@ -1197,11 +1197,13 @@ static void init_request_info(void)
|
||||
env_script_name[env_script_file_info_start] = 0;
|
||||
SG(request_info).request_uri = FCGI_PUTENV(request, "SCRIPT_NAME", env_script_name);
|
||||
}
|
||||
if (decoded_path_info) {
|
||||
efree(decoded_path_info);
|
||||
}
|
||||
}
|
||||
env_path_info = FCGI_PUTENV(request, "PATH_INFO", path_info);
|
||||
if (decoded_path_info) {
|
||||
env_path_info = FCGI_PUTENV(request, "PATH_INFO", decoded_path_info);
|
||||
efree(decoded_path_info);
|
||||
} else {
|
||||
env_path_info = FCGI_PUTENV(request, "PATH_INFO", path_info);
|
||||
}
|
||||
}
|
||||
if (!orig_script_filename ||
|
||||
strcmp(orig_script_filename, pt) != 0) {
|
||||
|
||||
@@ -39,7 +39,7 @@ $tester
|
||||
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%20+2',
|
||||
scriptName: $scriptName . '/1 +2'
|
||||
)
|
||||
->expectBody([$scriptName, $scriptName . '/1 +2', $sourceFilePath, '/1%20+2', $scriptName . '/1%20+2']);
|
||||
->expectBody([$scriptName, $scriptName . '/1 +2', $sourceFilePath, '/1 +2', $scriptName . '/1 +2']);
|
||||
$tester->terminate();
|
||||
$tester->close();
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ $tester
|
||||
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%202',
|
||||
scriptName: $scriptName . '/1 2'
|
||||
)
|
||||
->expectBody([$scriptName, $scriptName . '/1 2', $sourceFilePath, '/1%202', $scriptName . '/1%202']);
|
||||
->expectBody([$scriptName, $scriptName . '/1 2', $sourceFilePath, '/1 2', $scriptName . '/1 2']);
|
||||
$tester->terminate();
|
||||
$tester->close();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user