Bug #80509 [Fbk->NoF]: A bug of basename function

From: 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

« previous php.bugs (#231265) next »