php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60554 basename() broken with Spanish locales
Submitted: 2011-12-18 16:06 UTC Modified: 2011-12-21 15:59 UTC
Votes:2
Avg. Score:2.5 ± 0.5
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: yunosh@php.net Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.4.0RC3 OS:
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: yunosh@php.net
New email:
PHP Version: OS:

 

 [2011-12-18 16:06 UTC] yunosh@php.net
Description:
------------
See test script.

Test script:
---------------
LANG=es_ES php -r 'var_dump(basename("高&执&行&力&的&打&造.xls"));'

Expected result:
----------------
高&执&行&力&的&打&造.xls

Actual result:
--------------
&执&行&力&的&打&造.xls

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-12-21 15:59 UTC] cataphract@php.net
basename() features this warning:

basename() is locale aware, so for it to see the correct basename with multibyte character paths, the matching locale must be set using the setlocale() function.

As I understand, you're passign it utf-8 data while setting the locale to something else; this is not allowed.
 [2011-12-21 15:59 UTC] cataphract@php.net
-Status: Open +Status: Bogus
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jul 06 03:01:28 2020 UTC