mirror of
https://github.com/php/php-src.git
synced 2025-08-16 05:58:45 +02:00
Fix GH-17643: FPM with httpd ProxyPass encoded PATH_INFO env
Closes GH-17644
This commit is contained in:
parent
fd5d6ad5bd
commit
e48ceb0026
4 changed files with 13 additions and 7 deletions
4
NEWS
4
NEWS
|
@ -14,6 +14,10 @@ PHP NEWS
|
||||||
. Fixed bug GH-17718 (Calling static methods on an interface that has
|
. Fixed bug GH-17718 (Calling static methods on an interface that has
|
||||||
`__callStatic` is allowed). (timwolla)
|
`__callStatic` is allowed). (timwolla)
|
||||||
|
|
||||||
|
- FPM:
|
||||||
|
. Fixed bug GH-17643 (FPM with httpd ProxyPass encoded PATH_INFO env).
|
||||||
|
(Jakub Zelenka)
|
||||||
|
|
||||||
- LDAP:
|
- LDAP:
|
||||||
. Fixed bug GH-17704 (ldap_search fails when $attributes contains a
|
. Fixed bug GH-17704 (ldap_search fails when $attributes contains a
|
||||||
non-packed array with numerical keys). (nielsdos, 7u83)
|
non-packed array with numerical keys). (nielsdos, 7u83)
|
||||||
|
|
|
@ -1153,6 +1153,7 @@ static void init_request_info(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (tflag) {
|
if (tflag) {
|
||||||
|
char *decoded_path_info = NULL;
|
||||||
if (orig_path_info) {
|
if (orig_path_info) {
|
||||||
char old;
|
char old;
|
||||||
|
|
||||||
|
@ -1174,7 +1175,6 @@ static void init_request_info(void)
|
||||||
* As we can extract PATH_INFO from PATH_TRANSLATED
|
* As we can extract PATH_INFO from PATH_TRANSLATED
|
||||||
* it is probably also in SCRIPT_NAME and need to be removed
|
* it is probably also in SCRIPT_NAME and need to be removed
|
||||||
*/
|
*/
|
||||||
char *decoded_path_info = NULL;
|
|
||||||
size_t decoded_path_info_len = 0;
|
size_t decoded_path_info_len = 0;
|
||||||
if (strchr(path_info, '%')) {
|
if (strchr(path_info, '%')) {
|
||||||
decoded_path_info = estrdup(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;
|
env_script_name[env_script_file_info_start] = 0;
|
||||||
SG(request_info).request_uri = FCGI_PUTENV(request, "SCRIPT_NAME", env_script_name);
|
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 ||
|
if (!orig_script_filename ||
|
||||||
strcmp(orig_script_filename, pt) != 0) {
|
strcmp(orig_script_filename, pt) != 0) {
|
||||||
|
|
|
@ -39,7 +39,7 @@ $tester
|
||||||
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%20+2',
|
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%20+2',
|
||||||
scriptName: $scriptName . '/1 +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->terminate();
|
||||||
$tester->close();
|
$tester->close();
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ $tester
|
||||||
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%202',
|
scriptFilename: "proxy:fcgi://" . $tester->getAddr() . $sourceFilePath . '/1%202',
|
||||||
scriptName: $scriptName . '/1 2'
|
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->terminate();
|
||||||
$tester->close();
|
$tester->close();
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue