Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify router.php)

This commit is contained in:
Xinchen Hui 2016-06-24 18:08:16 -07:00
parent 53de1c2830
commit 0183a9af5a
2 changed files with 5 additions and 4 deletions

4
NEWS
View File

@ -2,6 +2,10 @@ PHP NEWS
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? ??? 2016 PHP 7.0.9
- CLI:
. Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify
router.php). (Laruence)
- GD:
. Fixed bug #43475 (Thick styled lines have scrambled patterns). (cmb)
. Fixed bug #53640 (XBM images require width to be multiple of 8). (cmb)

View File

@ -660,10 +660,7 @@ static void sapi_cli_server_register_variables(zval *track_vars_array) /* {{{ */
if (SG(request_info).path_translated) {
sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", SG(request_info).path_translated);
} else if (client->server->router) {
char *temp;
spprintf(&temp, 0, "%s/%s", client->server->document_root, client->server->router);
sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", temp);
efree(temp);
sapi_cli_server_register_variable(track_vars_array, "SCRIPT_FILENAME", client->server->router);
}
if (client->request.path_info) {
sapi_cli_server_register_variable(track_vars_array, "PATH_INFO", client->request.path_info);