#18942 [Opn->Fbk]: $PHP_SELF is set to HTTP_SERVER_VARS[PATH_INFO] if available
| From: | kalowsky@php.net | Date: | Fri, 16 Aug 2002 19:44:07 +0000 |
| Subject: | #18942 [Opn->Fbk]: $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-17046@lists.php.net to get a copy of this message | ||
ID: 18942
Updated by: kalowsky@php.net
Reported By: six@aegis-corp.org
-Status: Open
+Status: Feedback
Bug Type: Other web server
Operating System: Debian
PHP Version: 4.2.2
New Comment:
Okay can we have a sample script just to ensure that we may or may not
have fixed your issue?
Previous Comments:
------------------------------------------------------------------------
[2002-08-16 13:48:35] six@aegis-corp.org
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"));
------------------------------------------------------------------------
[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