From: jia dot cheng dot wu at gmail dot com
Operating system: WINDOWS 7
PHP version: 5.3.24
Package: Filesystem function related
Bug Type: Bug
Bug description:pathinfo bug handling extra "."
Description:
------------
Array returned by function pathinfo() contains wrong values when extra "."
is
introduced in the parameter, even though "." is a valid character of a
query
string.
Test script:
---------------
<php?
$test_url = "/test.php?q=".urlencode("hello this is a test 1.0");
echo "test_url:".$test_url.PHP_EOL;
var_dump(pathinfo($test_url));
?>
Expected result:
----------------
test_url:/test.php?q=hello+this+is+a+test+1.0
array(4) {
["dirname"]=>
string(1) "\"
["basename"]=>
string(35) "test.php?q=hello+this+is+a+test+1.0"
["extension"]=>
string(26) "q=hello+this+is+a+test+1.0"
["filename"]=>
string(4) "test"
}
Actual result:
--------------
test_url:/test.php?q=hello+this+is+a+test+1.0
array(4) {
["dirname"]=>
string(1) "\"
["basename"]=>
string(35) "test.php?q=hello+this+is+a+test+1.0"
["extension"]=>
string(1) "0"
["filename"]=>
string(33) "test.php?q=hello+this+is+a+test+1"
}
--
Edit bug report at https://bugs.php.net/bug.php?id=64754&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=64754&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=64754&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=64754&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=64754&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=64754&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64754&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=64754&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=64754&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=64754&r=support
Expected behavior: https://bugs.php.net/fix.php?id=64754&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64754&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64754&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=64754&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64754&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=64754&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=64754&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=64754&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64754&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64754&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=64754&r=mysqlcfg