Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 57840 - glob(...) broken in php 4.3.8
Summary: glob(...) broken in php 4.3.8
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: x86 Linux
: High major (vote)
Assignee: PHP Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-07-21 05:30 UTC by Alex Schultz
Modified: 2004-08-12 04:36 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Schultz 2004-07-21 05:30:41 UTC
The glob function is returning false rather than an empty array when nothing is found. 

see php bug: http://bugs.php.net/bug.php?id=28649

Reproducible: Always
Steps to Reproduce:
1. install php 4.3.8
2. create a php file with the following
<?
var_dump(glob("/some/dir/that/doesn/t/exist/filename.[nN][gG][a-zA-Z]"));
?>
3. php <your file>


Actual Results:  
it'll return bool(false)

Expected Results:  
it should have returned an empty array
Comment 1 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-07-21 08:52:42 UTC
you linked to an upstream bug that was fixed in 4.3.7, and i've never seen it myself, somewhere you are in error.
Comment 2 Alex Schultz 2004-07-21 13:24:31 UTC
well it's in php 4.3.8 in the gentoo package.  I found this bug last night at about 4:30 am when doing system upgrades and it managed to hose a bunch of stuff.  The glob(...) function call was returning false rather than an empty array.  I had to back it out and reinstalled 4.3.6-r1 and everything was fine.

4.3.8 server:
websvr root # php -v ; cat test.php ; php test.php
PHP 4.3.8 (cli) (built: Jul 21 2004 04:43:13)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge
<?
var_dump(glob("/filename.[nN][gG][a-zA-Z]"));
?>
bool(false)

4.3.6 server:
sftp root # php -v ; cat test.php ; php test.php
PHP 4.3.6 (cli) (built: Jul 21 2004 05:16:33)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
    with the ionCube PHP Accelerator v1.3.3r2, Copyright (c) 2001-2002, by Nick Lindridge
<?
var_dump(glob("/filename.[nN][gG][a-zA-Z]"));
?>
array(0) {
}
Comment 3 Alex Schultz 2004-07-21 13:46:38 UTC
http://bugs.php.net/bug.php?id=29246

it poped up in 4.3.8, it has been fixed in cvs.  so i'm not imagining things :)
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-08-07 13:18:19 UTC
if you'd like to isolate the fix responsible and post it here, I'll put it in our tree.
Comment 5 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2004-08-12 04:36:13 UTC
4.3.9rc1 is in the tree, and contains a fix.