com php-src: Fixed bug #72484 (SCRIPT_FILENAME shows wr ong path if the user specify router.php): N EWS sapi/cli/php_cli_server.c
| From: | Xinchen Hui | Date: | Sat, 25 Jun 2016 01:08:16 +0000 |
| Subject: | com php-src: Fixed bug #72484 (SCRIPT_FILENAME shows wr ong path if the user specify router.php): N EWS sapi/cli/php_cli_server.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-92643@lists.php.net to get a copy of this message | ||
Commit: 0183a9af5ac6e186d554634b854a3a86d5830d6d
Author: Xinchen Hui <laruence@gmail.com> Fri, 24 Jun 2016 18:08:16 -0700
Parents: 53de1c283053d91cb4add279cad507d000d77a51
Branches: PHP-7.0 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0183a9af5ac6e186d554634b854a3a86d5830d6d
Log:
Fixed bug #72484 (SCRIPT_FILENAME shows wrong path if the user specify router.php)
Bugs:
https://bugs.php.net/72484
Changed paths:
M NEWS
M sapi/cli/php_cli_server.c
Diff:
diff --git a/NEWS b/NEWS
index 4fd07fd..7904f77 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 f94ac74..b9c1f34 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);