Bug #67048 [NEW]: pathinfo() incorrectly parsing hidden file paths
| From: | russellbarnhart at gmail dot com | Date: | Wed, 09 Apr 2014 12:51:23 +0000 |
| Subject: | Bug #67048 [NEW]: pathinfo() incorrectly parsing hidden file paths | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-185154@lists.php.net to get a copy of this message | ||
From: russellbarnhart at gmail dot com
Operating system: *nix
PHP version: Irrelevant
Package: Filesystem function related
Bug Type: Bug
Bug description:pathinfo() incorrectly parsing hidden file paths
Description:
------------
The function pathinfo() assumes all files that have a basename starting
with a period only have an extension.
This bug is present in at least 5.3.x to 5.5.x.
Test script:
---------------
# copy & paste into a shell
php -r "print_r(pathinfo('/some/path/.test'));"
Expected result:
----------------
Array
(
[dirname] => /some/path
[basename] => .test
[extension] =>
[filename] => .test
)
Actual result:
--------------
Array
(
[dirname] => /some/path
[basename] => .test
[extension] => test
[filename] =>
)
--
Edit bug report at https://bugs.php.net/bug.php?id=67048&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=67048&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=67048&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=67048&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=67048&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=67048&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=67048&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=67048&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=67048&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=67048&r=support
Expected behavior: https://bugs.php.net/fix.php?id=67048&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=67048&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=67048&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=67048&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=67048&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=67048&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=67048&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=67048&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=67048&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=67048&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=67048&r=mysqlcfg