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
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: vasilii dot b dot shpilchin at gmail dot com
New email:
PHP Version: OS:

 

 [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: Fri Apr 19 03:01:27 2024 UTC