Bug #78817 [Com]: pathinfo() on filenames starting with utf-8 character fails
| From: | jasverix at gmail dot com | Date: | Fri, 15 Nov 2019 10:42:22 +0000 |
| Subject: | Bug #78817 [Com]: pathinfo() on filenames starting with utf-8 character fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223725@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=78817&edit=1
ID: 78817
Comment by: jasverix at gmail dot com
Reported by: jasverix at gmail dot com
Summary: pathinfo() on filenames starting with utf-8
character fails
Status: Open
Type: Bug
Package: Filesystem function related
Operating System: Debian Linux
PHP Version: 7.2.24
Block user comment: N
Private report: N
New Comment:
PHP Version:
PHP 7.2.24-1+0~20191026.31+debian10~1.gbpbbacde (cli) (built: Oct 26 2019 14:20:35) ( NTS )
Copyright (c) 1997-2018 The PHP Group
Zend Engine v3.2.0, Copyright (c) 1998-2018 Zend Technologies
with Zend OPcache v7.2.24-1+0~20191026.31+debian10~1.gbpbbacde, Copyright (c) 1999-2018, by Zend
Technologies
Previous Comments:
------------------------------------------------------------------------
[2019-11-15 10:41:28] jasverix at gmail dot com
Description:
------------
We have a filename starting with a non-ASCII filename character like "Ã",
"Ã" or "Ã
". Then we try to get the filename without extension using
PATHINFO_FILENAME.
PHP will trim the first character from the resulting string.
Test script:
---------------
<?php
$fileName = 'Ã
fileÃ
nameÃ
.docx';
// outputs "fileÃ
nameÃ
" - missing starting character
echo pathinfo($fileName, PATHINFO_FILENAME) . "\n";
Expected result:
----------------
Ã
fileÃ
nameÃ
Actual result:
--------------
fileÃ
nameÃ
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=78817&edit=1