Bug #3205: $PHP_SELF is getting set incorrectly when force-cgi-redirect not set in CGI
| From: | ra9104 at email dot sps dot mot dot com | Date: | Thu, 13 Jan 2000 20:59:09 +0000 |
| Subject: | Bug #3205: $PHP_SELF is getting set incorrectly when force-cgi-redirect not set in CGI | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-14596@lists.php.net to get a copy of this message | ||
From: ra9104@email.sps.mot.com
Operating system: Solaris 2.6
PHP version: 3.0.14
PHP Bug Type: Misbehaving function
Bug description: $PHP_SELF is getting set incorrectly when force-cgi-redirect not set in CGI
I am running the CGI binary under Netscape Enterprise Server 3.5.1E
./configure --with-gd=/export/home/webber/gd1.3 --with-oracle=/export/home/ora_home
--with-ldap=/export/home/webber --with-mysql=/usr/local/mysql --enable-track-vars
--enable-discard-path --with-imap=/export/home/webber
Upgraded from 3.0.12 to 3.0.14 and found the following behavior to change:
When accessing a URL such as "http://www.server.nam/dir/" $PHP_SELF would be set
to /dir//dir/index.phtml but when accessing the same script by accessing "http://www.server.nam/dir/index.phtml"
$PHP_SELF would be set correctly to /dir/index.phtml
Noticed that when calling the first URL that $SCRIPT_NAME would be set to the directory of the
script but not have the actual filename, in main.c if $SCRIPT_NAME is set and does not contain the
same value as $PATH_INFO then they will be concatenated and passed into $PHP_SELF, this is what was
causing the error.
I modified main.c to not use GLOBAL(request_info).script_name when assembling the value for
$PHP_SELF and it worked fine.
Used an index.php3 script with <? phpinfo(); ?> in it to check the behavior.