Bug #80509 [NEW]: A bug of basename function

From: Date: Sun, 13 Dec 2020 11:15:32 +0000
Subject: Bug #80509 [NEW]: A bug of basename function
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-231054@lists.php.net to get a copy of this message
From:             amanjiang at gmail dot com
Operating system: Windows 10
PHP version:      7.4.13
Package:          *General Issues
Bug Type:         Bug
Bug description:A bug of basename function

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 bug report at https://bugs.php.net/bug.php?id=80509&edit=1
-- 
Fix committed:                    https://bugs.php.net/fix.php?id=80509&r=fixed
Fixed in release:                 https://bugs.php.net/fix.php?id=80509&r=alreadyfixed
Need backtrace:                   https://bugs.php.net/fix.php?id=80509&r=needtrace
Need Reproduce Script:            https://bugs.php.net/fix.php?id=80509&r=needscript
Try newer version:                https://bugs.php.net/fix.php?id=80509&r=oldversion
Not developer issue:              https://bugs.php.net/fix.php?id=80509&r=support
Expected behavior:                https://bugs.php.net/fix.php?id=80509&r=notwrong
Not enough info:                  https://bugs.php.net/fix.php?id=80509&r=notenoughinfo
Submitted twice:                  https://bugs.php.net/fix.php?id=80509&r=submittedtwice
register_globals:                 https://bugs.php.net/fix.php?id=80509&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80509&r=phptooold
Daylight Savings:                 https://bugs.php.net/fix.php?id=80509&r=dst
IIS Stability:                    https://bugs.php.net/fix.php?id=80509&r=isapi
Install GNU Sed:                  https://bugs.php.net/fix.php?id=80509&r=gnused
Floating point limitations:       https://bugs.php.net/fix.php?id=80509&r=float
No Zend Extensions:               https://bugs.php.net/fix.php?id=80509&r=nozend
MySQL Configuration Error:        https://bugs.php.net/fix.php?id=80509&r=mysqlcfg


Thread (3 messages)

« previous php.bugs (#231054) next »