php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74414 basename() random result with unicode filename
Submitted: 2017-04-11 12:40 UTC Modified: 2017-04-23 04:22 UTC
Votes:3
Avg. Score:4.3 ± 0.9
Reproduced:2 of 2 (100.0%)
Same Version:2 (100.0%)
Same OS:2 (100.0%)
From: vasilii dot b dot shpilchin at gmail dot com Assigned:
Status: No Feedback Package: Unicode Engine related
PHP Version: 7.1.3 OS: CentOS 7.2 x64
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
47 - 17 = ?
Subscribe to this entry?

 
 [2017-04-11 12:40 UTC] 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

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-04-14 16:20 UTC] ab@php.net
-Status: Open +Status: Feedback
 [2017-04-14 16:20 UTC] 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-14 16:28 UTC] ab@php.net
Seems a single byte encoding issue. UTF-8 is fine.

Thanks.
 [2017-04-23 04:22 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Re-Opened". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 23:01:34 2024 UTC