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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
38 + 49 = ?
Subscribe to this entry?

 
 [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-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 11:01:27 2024 UTC