#18942 [Opn]: $PHP_SELF is set to HTTP_SERVER_VARS[PATH_INFO] if available

From: Date: Fri, 16 Aug 2002 17:48:36 +0000
Subject: #18942 [Opn]: $PHP_SELF is set to HTTP_SERVER_VARS[PATH_INFO] if available
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-17034@lists.php.net to get a copy of this message
ID: 18942 User updated by: six@aegis-corp.org Reported By: six@aegis-corp.org Status: Open Bug Type: Other web server Operating System: Debian PHP Version: 4.2.2 New Comment: I checked and this bug revives #14307 which died some time ago unfixed. The code in question is in sapi/cgi/cgi_main.c : SG(request_info).request_uri = getenv("PATH_INFO"); if (!SG(request_info).request_uri) { SG(request_info).request_uri = getenv("SCRIPT_NAME"); } Should be more like : SG(request_info).request_uri = getenv("SCRIPT_NAME"); strcat(SG(request_info).request_uri, getenv("PATH_INFO")); Previous Comments: ------------------------------------------------------------------------ [2002-08-16 13:39:03] six@aegis-corp.org With the CGI version of PHP, $PHP_SELF is always set to the value of HTTP_SERVER_VARS[PATH_INFO] if it is available. But the PATH_INFO server var does not at all designate the running script, which is by the SCRIPT_NAME var. This causes scripts using path_info (URLs like http://www.example.com/script/arg1/arg2/argX) to fail when using self refering links on a server using the CGI version on PHP. This bus does not exists with the apache module. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=18942&edit=1

« previous php.bugs (#17034) next »