#24340 [Opn]: basename with / and \

From: Date: Fri, 27 Jun 2003 10:57:51 +0000
Subject: #24340 [Opn]: basename with / and \
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-42619@lists.php.net to get a copy of this message
 ID:               24340
 User updated by:  nagger at gmx dot de
 Reported By:      nagger at gmx dot de
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: WinXP
 PHP Version:      4.3.2
 New Comment:

Sorry, I have mixed-up 'Expected Result' and 'Actual Result'.


Previous Comments:
------------------------------------------------------------------------

[2003-06-25 18:20:47] nagger at gmx dot de

Description:
------------
on WinXP basename() fails if there are slashes *and* backslashes in
path:

basename('foo/bla\bar') is 'bla\bar' instead of 'bar'

dirname('foo/bla\bar') is 'foo/bla' -> correct

Reproduce code:
---------------
echo basename('foo/bla/bar');
echo basename('foo\bla\bar');
echo basename('foo/bla\bar'); //this fails
echo basename('foo\bla/bar');

echo dirname('foo/bla/bar');
echo dirname('foo\bla\bar');
echo dirname('foo/bla\bar');
echo dirname('foo\bla/bar');

Expected result:
----------------
bar
bar
bla\bar
bar
foo/bla
foo\bla
foo/bla
foo\bla

Actual result:
--------------
bar
bar
bar
bar
foo/bla
foo\bla
foo/bla
foo\bla


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24340&edit=1



Thread (3 messages)

« previous php.bugs (#42619) next »