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: 2014-05-21 17:41 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:
Status: Open Package: Filesystem function related
PHP Version: 5.4.28 OS: Ubuntu 10.04
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [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
 
PHP Copyright © 2001-2018 The PHP Group
All rights reserved.
Last updated: Mon Oct 22 03:01:25 2018 UTC