php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67277 glob ignores files with wrongly encoded chars
Submitted: 2014-05-14 14:20 UTC Modified: 2021-09-26 04:22 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: l dot werner at sprengnetter dot de Assigned: cmb (profile)
Status: No Feedback Package: Filesystem function related
PHP Version: 5.4.28 OS: Ubuntu 10.04
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: l dot werner at sprengnetter dot de
New email:
PHP Version: OS:

 

 [2014-05-14 14:20 UTC] l dot werner at sprengnetter dot de
Description:
------------
We upload files with winscp to our server.
On the server we have an script which imports these files.

Some of the files have german umlauts.
These are somewhat wrongly encoded.
When I try to use glob to read all files in an dir with such an file this file will be silently ignored.

Test script:
---------------
> ls -l
total 972
-rw-r--r--+ 1 dholler dholler  69288 2014-04-08 12:21 00442_115_102_GBA.pdf
-rw-r--r--+ 1 dholler dholler 211968 2014-04-08 12:27 00442_305_31_ueber_2013_1[1].xls
-rw-r--r--+ 1 dholler dholler  19523 2014-04-08 14:55 00442_325_32_stob3_2013_1_1_.xlsx
-rw-r--r--+ 1 dholler dholler 142640 2014-04-25 09:35 00442 BV-001.jpg
-rw-r--r--+ 1 dholler dholler 120271 2014-04-25 09:35 00442 BV-002.jpg
-rw-r--r--+ 1 dholler dholler 277317 2014-04-23 08:20 00442 Einverst?ndniserkl?rung.pdf
-rw-r--r--+ 1 dholler dholler 124950 2014-04-25 09:31 00442 SolumGBA.pdf
-rw-r--r--+ 1 dholler dholler  17920 2014-04-25 09:42 Thumbs.db


> echo '<?php print_r(glob("*"));' | php
Array
(
    [0] => 00442_115_102_GBA.pdf
    [1] => 00442_305_31_ueber_2013_1[1].xls
    [2] => 00442_325_32_stob3_2013_1_1_.xlsx
    [3] => 00442 BV-001.jpg
    [4] => 00442 BV-002.jpg
    [5] => 00442 SolumGBA.pdf
    [6] => Thumbs.db
)





Expected result:
----------------
File will not be ignored an i get an error message or even better the file can be handled.

Actual result:
--------------
File is ignored.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-05-21 17:41 UTC] aharvey@php.net
-Package: *General Issues +Package: Filesystem function related
 [2021-09-13 08:14 UTC] cmb@php.net
-Status: Open +Status: Feedback -Assigned To: +Assigned To: cmb
 [2021-09-13 08:14 UTC] cmb@php.net
Is this still an issue for you with any of the actively supported
PHP versions[1]?

[1] <https://www.php.net/supported-versions.php>
 [2021-09-26 04:22 UTC] php-bugs at lists dot php dot net
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.
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sat Oct 16 20:03:36 2021 UTC