php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #37268 basename() doesnt work with non-latin first letters of the file.
Submitted: 2006-05-01 23:56 UTC Modified: 2006-05-03 10:44 UTC
Votes:16
Avg. Score:4.6 ± 0.6
Reproduced:13 of 14 (92.9%)
Same Version:7 (53.8%)
Same OS:4 (30.8%)
From: spam dot bugs dot php dot net at vano dot org Assigned:
Status: Wont fix Package: Filesystem function related
PHP Version: 5.1.2 OS: Fedora Core 4
Private report: No CVE-ID:
Have you experienced this issue?
Rate the importance of this bug to you:

 [2006-05-01 23:56 UTC] spam dot bugs dot php dot net at vano dot org

Patches

UTF8 (last revision 2011-05-18 08:18 UTC) by vsz at ya dot ru)

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-05-02 00:55 UTC] judas dot iscariote at gmail dot com
you have to wait PHP6, it will address this problems.
 [2010-07-31 23:21 UTC] daniel at mameso dot com
a workaround:

# workaround for splitting basename whith beginning utf8 multibyte char
function mb_basename($filepath, $suffix = NULL) {
	$splited = preg_split ( '/\//', rtrim ( $filepath, '/ ' ) );
	return substr ( basename ( 'X' . $splited [count ( $splited ) - 1], 
$suffix ), 1 );
}

have fun,
Daniel.

PS: the problem does not exist under MAC OSX 10.6.x with ZendServerCE 5.0 & 
PHP5.3
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 20:02:01 2014 UTC