Bug #47358 [PATCH]: glob returns error, should be empty array()
| From: | pajoye@php.net | Date: | Sun, 09 Oct 2011 17:08:22 +0000 |
| Subject: | Bug #47358 [PATCH]: glob returns error, should be empty array() | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-164196@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=47358&edit=1
ID: 47358
Patch added by: pajoye@php.net
Reported by: php at guggemand dot dk
Summary: glob returns error, should be empty array()
Status: Assigned
Type: Bug
Package: Safe Mode/open_basedir
Operating System: FreeBSD 7.1
PHP Version: 5.2.9RC1
Assigned To: pajoye
Block user comment: N
Private report: N
New Comment:
The following patch has been added/updated:
Patch Name: open_basedir_error_fix
Revision: 1318180102
URL: https://bugs.php.net/patch-display.php?bug=47358&patch=open_basedir_error_fix&revision=1318180102
Previous Comments:
------------------------------------------------------------------------
[2011-10-09 16:51:14] pajoye@php.net
Please try using this patch (against 5.4 but should work against 5.3). I will
remove the warning too to make it works like the other call (was just to ease the
test).
------------------------------------------------------------------------
[2011-10-09 16:50:22] pajoye@php.net
The following patch has been added/updated:
Patch Name: open_basedir_error_fix
Revision: 1318179021
URL: https://bugs.php.net/patch-display.php?bug=47358&patch=open_basedir_error_fix&revision=1318179021
------------------------------------------------------------------------
[2011-10-09 16:39:03] pajoye@php.net
I agree, there is no error here but a wrong test. I will fix it soonish, checking
the logic in there.
------------------------------------------------------------------------
[2011-10-04 14:32:45] harald dot lapp at gmail dot com
It seems to me, that "glob" is returning false, even though the path i try to glob
is valid compared to the "open_basdir" settings. Could you please have a further
look at this issue?
(tried this with php 5.3.6 and php 5.3.8, btw.)
------------------------------------------------------------------------
[2009-02-12 10:52:09] php at guggemand dot dk
"an empty array if no file matched" is what i see in the manual.
but this returns error, and not an empty array()
glob("/path/allowd/in/open_basedir/nonexitentfile.*");
I can understand why a system glob call returning no files, and a call returning only nonallowed
files has to be treated the same.
But im to dumb to see the logic in treating both as errors instead of "no files matched",
especially because that breaks existing code.
And treating it as "no files matched" doesnt break anything.
Please enlighten me if im wrong, and ill put on my pointy hat and sit in the corner for the rest of
the day.
But now i have link i can give the users telling me my servers doesn't work right. So i guess i
can live with that.
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
https://bugs.php.net/bug.php?id=47358
--
Edit this bug report at https://bugs.php.net/bug.php?id=47358&edit=1