Bug #78817 [Opn->Nab]: pathinfo() on filenames starting with utf-8 character fails
| From: | sjon@php.net | Date: | Fri, 15 Nov 2019 10:51:12 +0000 |
| Subject: | Bug #78817 [Opn->Nab]: pathinfo() on filenames starting with utf-8 character fails | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-223726@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
Updated by: sjon@php.net
Reported by: jasverix at gmail dot com
Summary: pathinfo() on filenames starting with utf-8
character fails
-Status: Open
+Status: Not a bug
Type: Bug
Package: Filesystem function related
Operating System: Debian Linux
PHP Version: 7.2.24
Block user comment: N
Private report: N
New Comment:
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
This is documented - see https://www.php.net/pathinfo
> Caution
>
> pathinfo() is locale aware, so for it to parse a path containing multibyte characters
> correctly, the matching locale must be set using the setlocale() function.
Previous Comments:
------------------------------------------------------------------------
[2019-11-15 10:42:22] jasverix at gmail dot com
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
------------------------------------------------------------------------
[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