php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #5707 dirname does not handle paths not starting with "/" properly
Submitted: 2000-07-20 19:29 UTC Modified: 2000-07-21 23:16 UTC
From: ccurtis at aet-usa dot com Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 4.0.0 OS: Linux (debian/unstable)
Private report: No CVE-ID: None
 [2000-07-20 19:29 UTC] ccurtis at aet-usa dot com
	echo dirname( "/1/2/3" ) . " --" .
	     dirname( "/1/2"   ) . " --" .
	     dirname( "/1"     ) . "<br>" .
	     dirname( "1/2/3"  ) . " --" .
	     dirname( "1/2"    ) . " --" .
	     dirname( "1"      ) . "<p>";


These should produce the same output in the final condition: a null/empty string, but this is the output:

/1/2 --/1 --
1/2 --1 --1

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-07-20 20:51 UTC] hholzgra at cvs dot php dot net
fixes are on the way to cvs
 [2000-07-21 23:16 UTC] andrei at cvs dot php dot net
test
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Oct 10 16:00:02 2026 UTC