#29690 [Opn]: pathinfo() reports wrong directory name
| From: | ressourceweb at hotmail dot com | Date: | Mon, 16 Aug 2004 15:09:07 +0000 |
| Subject: | #29690 [Opn]: pathinfo() reports wrong directory name | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-64715@lists.php.net to get a copy of this message | ||
ID: 29690
User updated by: ressourceweb at hotmail dot com
Reported By: ressourceweb at hotmail dot com
Status: Open
Bug Type: Apache2 related
Operating System: Windows XP Home Edition
PHP Version: 5.0.0
New Comment:
First of all, my bug report example should have been
<?php
$pathdata=pathinfo($SCRIPT_NAME);
echo $pathdata["dirname"];
?>
instead of
<?php
$pathdata=pathinfo($SCRIPT_FILENAME);
echo $pathdata["dirname"];
?>
also, i noticed that the pathinfo() function behaves correctly. it is
the variable SCRIPT_NAME that contains wrong information
Previous Comments:
------------------------------------------------------------------------
[2004-08-15 22:54:23] ressourceweb at hotmail dot com
Description:
------------
Steps to reproduce the problem :
- Apache HTTPd Server 2.0.50
- PHP 5.0.0
- MultiViews ENABLED
Trying to use the pathinfo($SCRIPT_FILENAME); command on a script
called using double slashes in the URL (like
http://localhost/php/test/pathinfo/argument/http//url)
will return
wrong directory information
Reproduce code:
---------------
<?php
/*
* File name : pathinfo.php
* Directory : /php/test/
* Script filename : /php/test/pathinfo.php
* Called in browser the following way :
* http://localhost/php/test/pathinfo/argument/http//url
*/
$pathdata=pathinfo($SCRIPT_FILENAME);
echo $pathdata["dirname"];
?>
Expected result:
----------------
/php/test/
Actual result:
--------------
/php/test/argument/http//
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=29690&edit=1