php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25450 dirname() not working correct
Submitted: 2003-09-09 09:53 UTC Modified: 2003-09-09 15:49 UTC
From: robert_hunter21 at yahoo dot co dot uk Assigned:
Status: Not a bug Package: Directory function related
PHP Version: 4.3.3 OS: windows 2000
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: robert_hunter21 at yahoo dot co dot uk
New email:
PHP Version: OS:

 

 [2003-09-09 09:53 UTC] robert_hunter21 at yahoo dot co dot uk
Description:
------------
After updating to version 4.3.3 dirname() is not working properly (or the same as in 4.3.0 at least).

dirname($_SERVER['PHP_SELF']) does not give directory path.

Reproduce code:
---------------
<?

echo dirname($_SERVER['PHP_SELF']);

?>

Expected result:
----------------
/test 

Actual result:
--------------
\

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-09-09 11:21 UTC] sniper@php.net
What SAPI are you using? (what webserver?)
What does 'echo $_SERVER['PHP_SELF'];' output?

 [2003-09-09 11:43 UTC] robert_hunter21 at yahoo dot co dot uk
The test webserver I am running it on is xitami.

redirect.php is my file which generates the error, the url for that file is -
http://localhost/test/redirect.php
So it should output- /test

in 4.3.0
'echo $_SERVER['PHP_SELF']; 

outputs- /test

so that is correct, but

in 4.3.3
'echo $_SERVER['PHP_SELF']; 

outputs- \
 [2003-09-09 11:45 UTC] robert_hunter21 at yahoo dot co dot uk
The test webserver I am running it on is xitami.

redirect.php is my file which generates the error, the url for that file is -
http://localhost/test/redirect.php
So it should output- /test

in 4.3.0
echo $_SERVER['PHP_SELF']; 

outputs- /test

so that is correct, but

in 4.3.3
echo $_SERVER['PHP_SELF']; 

outputs- \
 [2003-09-09 14:20 UTC] roberthunter21 at yahoo dot co dot uk
This seems to be just specific to the xitami server because I just finished testing it on IIS and it works.
 [2003-09-09 15:49 UTC] sniper@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments
to the existing bug instead.

Thank you for your interest in PHP.

See bug #25448
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Aug 10 20:01:24 2020 UTC