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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
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

Pull Requests

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-2025 The PHP Group
All rights reserved.
Last updated: Tue Jul 01 12:01:36 2025 UTC