Bug #74414 [Fbk]: basename() random result with unicode filename
| From: | ab@php.net | Date: | Fri, 14 Apr 2017 16:28:16 +0000 |
| Subject: | Bug #74414 [Fbk]: basename() random result with unicode filename | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-208556@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=74414&edit=1
ID: 74414
Updated by: ab@php.net
Reported by: vasilii dot b dot shpilchin at gmail dot com
Summary: basename() random result with unicode filename
Status: Feedback
Type: Bug
Package: Unicode Engine related
Operating System: CentOS 7.2 x64
PHP Version: 7.1.3
Block user comment: N
Private report: N
New Comment:
Seems a single byte encoding issue. UTF-8 is fine.
Thanks.
Previous Comments:
------------------------------------------------------------------------
[2017-04-14 16:20:59] ab@php.net
Thanks for the report. There should be no difference in SAPI, the function is same everywhere.
Likely that the input encoding is different. If you use var_dump(), the length will likely reveal
whether a single byte encoding is used.
Thanks.
------------------------------------------------------------------------
[2017-04-11 12:40:57] vasilii dot b dot shpilchin at gmail dot com
Description:
------------
The function basename() are random split a filename by first ASCII char. I get unexcepted actual
result in 1/3 cases with same filename.
I get actual result with mod_php, and never in CLI.
Test script:
---------------
<?php
echo basename('/имÑ.doc');
Expected result:
----------------
имÑ.doc
Actual result:
--------------
.doc
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=74414&edit=1