From: phpbugs at atu dot cjb dot net
Operating system: GNU/Linux
PHP version: 4.3.6
PHP Bug Type: Filesystem function related
Bug description: the glob() function does not match the same as shell wildcarding does
Description:
------------
A trailing forward slash is ignored by glob(), but is not with standard
UNIX wildcard matching.
ls -lp Dir
drwx------ 2 raven users 48 Jun 6 15:26 CSS/
drwx------ 2 raven users 48 Jun 6 15:26 Extra/
drwx------ 2 raven users 48 Jun 6 15:26 Images/
-rw------- 1 raven users 0 Jun 6 15:26 Main.data
-rw------- 1 raven users 0 Jun 6 15:26 index.php
echo Dir/*/
Dir/CSS/ Dir/Extra/ Dir/Images/
Reproduce code:
---------------
foreach (glob("Dir/*/") as $Dir) { echo "$Dir "; }
Expected result:
----------------
Dir/CSS/ Dir/Extra/ Dir/Images/
Actual result:
--------------
Dir/CSS/ Dir/Extra/ Dir/Images/ Dir/Main.data Dir/index.php
--
Edit bug report at http://bugs.php.net/?id=28656&edit=1
--
Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=28656&r=trysnapshot4
Try a CVS snapshot (php5): http://bugs.php.net/fix.php?id=28656&r=trysnapshot5
Fixed in CVS: http://bugs.php.net/fix.php?id=28656&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=28656&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=28656&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=28656&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=28656&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=28656&r=support
Expected behavior: http://bugs.php.net/fix.php?id=28656&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=28656&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=28656&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=28656&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=28656&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=28656&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=28656&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=28656&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=28656&r=float