php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53557 pathinfo() does not return correct values for path with accents in it
Submitted: 2010-12-16 16:03 UTC Modified: 2010-12-20 03:04 UTC
From: joris at notenbomer dot nl Assigned: kalle (profile)
Status: Closed Package: Filesystem function related
PHP Version: 5.3.4 OS: Debian Squeeze
Private report: No CVE-ID: None
 [2010-12-16 16:03 UTC] joris at notenbomer dot nl
Description:
------------
NOTE: phpinfo() lists the PHP version as 5.3.3-6

when using pathinfo() on a path, say, '/tmp/ë.txt', it will not give the correct 
filename and basename (but will give the correct path).

Test script:
---------------
// will function correctly
print_r(pathinfo('/var/tmp/aëä.txt'));
// will leave out the first ë
print_r(pathinfo('/var/tmp/ëaä.txt'));
//will leave out ëä
print_r(pathinfo('/var/tmp/ëäa.txt'));


Expected result:
----------------
Array
(
    [dirname] => /var/tmp
    [basename] => aëä.txt
    [extension] => txt
    [filename] => aëä
)
Array
(
    [dirname] => /var/tmp
    [basename] => ëaä.txt
    [extension] => txt
    [filename] => ëaä
)
Array
(
    [dirname] => /var/tmp
    [basename] => ëäa.txt
    [extension] => txt
    [filename] => ëäa
)

Actual result:
--------------
Array
(
    [dirname] => /var/tmp
    [basename] => aëä.txt
    [extension] => txt
    [filename] => aëä
)
Array
(
    [dirname] => /var/tmp
    [basename] => aä.txt
    [extension] => txt
    [filename] => aä
)
Array
(
    [dirname] => /var/tmp
    [basename] => a.txt
    [extension] => txt
    [filename] => a
)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-12-16 18:14 UTC] cataphract@php.net
-Type: Bug +Type: Documentation Problem
 [2010-12-16 18:14 UTC] cataphract@php.net
This is a locale issue; see the note in basename(); it should probably be copied to the page for pathinfo.
 [2010-12-20 03:04 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=306483
Log: Fixed bug #53557 (pathinfo() does not return correct values for path with accents in it)
 [2010-12-20 03:04 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-12-20 03:04 UTC] kalle@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.


 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=f5d5459f49bf7825aa6f85be57ca9939dc708617
Log: Fixed bug #53557 (pathinfo() does not return correct values for path with accents in it)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 06 08:01:33 2024 UTC