From 0183a9af5ac6e186d554634b854a3a86d5830d6d Mon Sep 17 00:00:00 2001 From: Xinchen Hui Date: Fri, 24 Jun 2016 18:08:16 -0700 Subject: [PATCH] Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify router.php) --- NEWS | 4 ++++ sapi/cli/php_cli_server.c | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/NEWS b/NEWS index 4fd07fdcefc19..7904f771b1e82 100644 --- a/NEWS +++ b/NEWS @@ -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) diff --git a/sapi/cli/php_cli_server.c b/sapi/cli/php_cli_server.c index f94ac74741592..b9c1f342ca56a 100644 --- a/sapi/cli/php_cli_server.c +++ b/sapi/cli/php_cli_server.c @@ -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);