php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #34314 function basename & pathinfo is wrong for chinese filename.
Submitted: 2005-08-31 09:24 UTC Modified: 2005-08-31 09:38 UTC
From: neo at csba dot com dot cn Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 5.0.4 OS: WIN2003
Private report: No CVE-ID: None
 [2005-08-31 09:24 UTC] neo at csba dot com dot cn
Description:
------------
i use function basename and pathinfo proess chinese filename, 

$filename = "D:\\ftpserver\\?м???????ѧ?ڶ?ʮһ??.wmv";

echo basename($filename);

result is : .wmv


$at = pathinfo($filename);
echo $at['basename'];

reseult is : .wmv

is not ?м???????ѧ?ڶ?ʮһ??.wmv




Reproduce code:
---------------
$filename = "D:\\ftpserver\\?м???????ѧ?ڶ?ʮһ??.wmv";

echo basename($filename);

$at = pathinfo($filename);
echo $at['basename'];

Expected result:
----------------
?м???????ѧ?ڶ?ʮһ??.wmv

Actual result:
--------------
.wmv

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-08-31 09:38 UTC] sniper@php.net
Use addslashes() on the filename.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon Jul 01 09:01:31 2024 UTC