Bug #80509 [Fbk->NoF]: A bug of basename function
| From: | php-bugs at lists dot php dot net | Date: | Sun, 27 Dec 2020 04:22:10 +0000 |
| Subject: | Bug #80509 [Fbk->NoF]: A bug of basename function | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-231265@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=80509&edit=1
ID: 80509
Updated by: php-bugs@lists.php.net
Reported by: amanjiang at gmail dot com
Summary: A bug of basename function
-Status: Feedback
+Status: No Feedback
Type: Bug
Package: *General Issues
Operating System: Windows 10
PHP Version: 7.4.13
Assigned To: cmb
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[2020-12-14 11:08:30] cmb@php.net
First, basename() is locale aware, so this issue might be related
to that. Which locale do you use? You can check with
echo setlocale(LC_CTYPE, 0);
Does the locale change for different requests?
Also, do you get these erroneous results with OPcache enabled or
disabled?
------------------------------------------------------------------------
[2020-12-13 11:15:32] amanjiang at gmail dot com
Description:
------------
The basename function *sometimes* cannot get the file name correctly in a path that containing
certain Chinese characters.
The following test script will be echo (If you restart the Apache server several times, this bug may
occur; obviously, there are two wrong results):
æ¾ç¤º
å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º
æç¤º
é示
表示
æ 示
æç¤º
å±ç¤º
æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º
æç¤º
å示
æç¤º
Test script:
---------------
<!doctype html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
<?php
echo
basename('æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º/æ¾ç¤º').'<br>';
echo
basename('å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º/å¼ç¤º').'<br>';
echo
basename('æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º').'<br>';
echo
basename('é示/é示/é示/é示/é示/é示/é示/é示/é示/é示').'<br>';
echo
basename('表示/表示/表示/表示/表示/表示/表示/表示/表示/表示').'<br>';
echo
basename('æ 示/æ 示/æ 示/æ 示/æ 示/æ 示/æ 示/æ 示/æ 示/æ 示').'<br>';
echo
basename('æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º').'<br>';
echo
basename('å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º/å±ç¤º').'<br>';
echo
basename('æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º/æ£ç¤º').'<br>';
echo
basename('æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º').'<br>';
echo
basename('å示/å示/å示/å示/å示/å示/å示/å示/å示/å示').'<br>';
echo
basename('æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º/æç¤º').'<br>';
?>
</body>
</html>
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80509&edit=1