php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #53262 basename() cannot handle argument with special characters like french "ééé"
Submitted: 2010-11-08 09:57 UTC Modified: 2010-11-17 09:48 UTC
From: frogone at fr dot firm dot lv Assigned: Kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.2.14 OS: debian
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: frogone at fr dot firm dot lv
New email:
PHP Version: OS:

 

 [2010-11-08 09:57 UTC] frogone at fr dot firm dot lv
Description:
------------
Like this report :http://bugs.php.net/bug.php?id=37945

but with php-cgi (and fcgid).

<?php
echo basename("./parent/ééé");
?>

result : parent


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-11-16 16:41 UTC] cataphract@php.net
-Type: Bug +Type: Documentation Problem -Package: CGI related +Package: Documentation problem
 [2010-11-16 16:41 UTC] cataphract@php.net
basename() uses php_mblen(), whose result depends on the locale:

Example (terminal using iso-8859-15):

glopes@nebm:~/php/php-t/bin$ LANG=pt_PT.utf8 php -r 'echo basename("./parent/\xe9\xe9\xe9"), "\n";'
parent
glopes@nebm:~/php/php-t/bin$ LANG=pt_PT.iso885915@euro php -r 'echo basename("./parent/\xe9\xe9\xe9"), "\n";'
ééé
 [2010-11-17 09:47 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305448
Log: Fixed bug #53262 (basename() cannot handle argument with special characters like french &quot;ééé&quot;)
 [2010-11-17 09:48 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=305449
Log: This also applies to dirname() -- bug #53262
 [2010-11-17 09:48 UTC] Kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: Kalle
 [2010-11-17 09:48 UTC] Kalle@php.net
This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation 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=c5168db28aef6112239299a2c8ca8c80b12a986b
Log: Fixed bug #53262 (basename() cannot handle argument with special characters like french &quot;ééé&quot;)
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 12 05:00:02 2025 UTC