basename function doesn't remove drive letter
| Bug #66395 | basename function doesn't remove drive letter | |||||||||
|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2014-01-03 07:12 UTC | Modified: | 2014-01-05 18:30 UTC |
|
||||||
| From: | php at tokumaru dot org | Assigned: | ab (profile) | |||||||
| Status: | Closed | Package: | Filesystem function related | |||||||
| PHP Version: | 5.5.7 | OS: | Windows | |||||||
| Private report: | No | CVE-ID: | None | |||||||
[2014-01-03 07:12 UTC] php at tokumaru dot org
Description:
------------
basename function doesn't remove drive letter(example C:) on WIndows.
if path includes directory separator characters('\' or '/'), basename function returns trailing name component of path.
But, if path doesn't include directory separator characters, basename function returns file name with drive letter.
Test script:
---------------
echo basename('c:autoexec.bat');
Expected result:
----------------
autoexec.bat
Actual result:
--------------
c:autoexec.bat
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2014-01-03 21:46 UTC] ab@php.net
-Status: Open +Status: Closed
[2014-01-03 22:09 UTC] ab@php.net
-Assigned To: +Assigned To: ab
[2014-01-05 12:46 UTC] php at tokumaru dot org
[2014-01-05 18:30 UTC] ab@php.net