Bug #67756 [NEW]: basename() malfunctions with non-ASCII characters
| From: | bugs dot php dot net at dw-perspective dot org dot uk | Date: | Mon, 04 Aug 2014 10:29:30 +0000 |
| Subject: | Bug #67756 [NEW]: basename() malfunctions with non-ASCII characters | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-186958@lists.php.net to get a copy of this message | ||
From: bugs dot php dot net at dw-perspective dot org dot uk
Operating system: Linux (Fedora)
PHP version: 5.5.15
Package: *Directory/Filesystem functions
Bug Type: Bug
Bug description:basename() malfunctions with non-ASCII characters
Description:
------------
basename() returns a false result if the paramater begins with a
non-ASCII character:
Confirmed on PHP 5.5.15 and 5.4.30.
The bug does not occur if the non-ASCII character is not first.
Reported previously on EOL-ed PHP version:
https://bugs.php.net/bug.php?id=62119 - no
resolution yet exists.
Test script:
---------------
Shell script to demonstrate problem:
# echo -n "uploads/й.png" > filename.txt
# LANG=C php -r 'echo
basename(file_get_contents("filename.txt"))."\n";'
.png
# LANG=en_US.UTF-8 php -r 'echo
basename(file_get_contents("filename.txt"))."\n";'
й.png
Shell script to demonstrate non-existence of problem if the non-ASCII
character is not first:
# echo -n "uploads/xй.png" > filename.txt
# LANG=C php -r 'echo
basename(file_get_contents("filename.txt"))."\n";'
xй.png
--
Edit bug report at https://bugs.php.net/bug.php?id=67756&edit=1
--