Bug #74414 [Opn->Fbk]: basename() random result with unicode filename

From: Date: Fri, 14 Apr 2017 16:21:02 +0000
Subject: Bug #74414 [Opn->Fbk]: basename() random result with unicode filename
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-208554@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:             Open
+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:

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.


Previous Comments:
------------------------------------------------------------------------
[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


Thread (4 messages)

« previous php.bugs (#208554) next »