From:             wiseman1024 at gmail dot com
Operating system: Windows 2000
PHP version:      4.3.9
PHP Bug Type:     Directory function related
Bug description:  glob() doesn't work inside directories with brackets [ ]

Description:
------------
glob() won't work (with any pattern and options whatsoever) when one
directory in the current working path has matching brackets [ and ] with
characters between the brackets.

This means glob() will fail if the current working directory is one of:
C:\php\[hello]
C:\php\[hello]\hello
C:\php\xxx[hello]xxx
C:\php\[hello][

It will work, for example, if the current working directory is one of:
C:\php
C:\php\[hello
C:\php\hello]
C:\php\hello[]

This seems to be a problem when using regular expressions in the
implementation of glob.

Reproduce code:
---------------
/* Returns a list of files and directories, unless inside a directory with
something between brackets*/

print_r(glob('*',FALSE)); 

Expected result:
----------------
Should always return an array with the files (assuming there are files in
the current directory)

Actual result:
--------------
Nothing, because glob() returned false

-- 
Edit bug report at http://bugs.php.net/?id=33047&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=33047&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=33047&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=33047&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=33047&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=33047&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=33047&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=33047&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=33047&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=33047&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=33047&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=33047&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=33047&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=33047&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=33047&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=33047&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=33047&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=33047&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=33047&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=33047&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=33047&r=mysqlcfg

Reply via email to