Bug #69628 [Ana->Csd]: glob() returns empty array on Windows 7, BUT not CentOS 6.7

From: Date: Thu, 21 May 2015 06:55:26 +0000
Subject: Bug #69628 [Ana->Csd]: glob() returns empty array on Windows 7, BUT not CentOS 6.7
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-192796@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=69628&edit=1

 ID:                 69628
 Updated by:         ab@php.net
 Reported by:        russ at herballure dot com
 Summary:            glob() returns empty array on Windows 7, BUT not
                     CentOS 6.7
-Status:             Analyzed
+Status:             Closed
 Type:               Bug
 Package:            Filesystem function related
 Operating System:   Windows 7 SP1 64-bit
 PHP Version:        5.6.8
 Block user comment: N
 Private report:     N

 New Comment:

Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=e42aae1e9bf5e15d8114c8ae4b5e99cc6e555d9b
Log: fix #69628: complex GLOB_BRACE fails on Windows


Previous Comments:
------------------------------------------------------------------------
[2015-05-13 23:16:38] cmb@php.net

See php-src/1278.

------------------------------------------------------------------------
[2015-05-13 12:29:47] cmb@php.net

As it is now, all but the last pair of brackets within a braced
alternative is simply ignored on Windows. So

  glob('D:\\Icons\\*.{[jJ][pP][gG],[gG][iI][fF]}', GLOB_BRACE);
  
is actually treated like

  glob('D:\\Icons\\*.{[gG],[fF]}', GLOB_BRACE);

------------------------------------------------------------------------
[2015-05-13 06:51:17] russ at herballure dot com

Description:
------------
When using glob() on Win 7 64 PHP 5.6.8,
when using GLOB_BRACE with multiple brackets within the braces,
glob() returns an empty array even when files match.
This same function works as expected on PHP 5.3.10 on CentOS 6.7.

Test script:
---------------
$x = glob('D:\\Icons\\*.{[jJ][pP][gG],[gG][iI][fF]}', GLOB_BRACE);
var_dump($x);

/*
The target directory "D:\Icons\" contains these files:
image1.jpg
image2.GIF
image3.bmp
*/

Expected result:
----------------
array(2) {
  [0]=> "D:\Icons\image1.jpg"
  [1]=> "D:\Icons\image2.GIF
}

Actual result:
--------------
array(0) {
}


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=69628&edit=1


Thread (4 messages)

« previous php.bugs (#192796) next »