ID: 44901
Updated by: [email protected]
Reported By: jake at yahoo-inc dot com
-Status: Open
+Status: Verified
Bug Type: Safe Mode/open_basedir
-Operating System: redhat e linux (2.6.9-42.ELsmp)
+Operating System: *
-PHP Version: 5.*
+PHP Version: 5.*, 6CVS (2009-03-16)
Previous Comments:
------------------------------------------------------------------------
[2008-05-03 00:41:11] jake at yahoo-inc dot com
Description:
------------
When using open_basedir as a prefix, attempting to access files or
directories which match the prefix but are not present on the filesystem
raise open_basedir restriction warnings.
Reproduce code:
---------------
// create files or directories on the file system "/foo1", "/foo2"
// add "/foo" (not "/foo/") to the open basedir restriction, then:
var_dump(file_exists('/foo1'));
var_dump(file_exists('/foo2'));
var_dump(file_exists('/foo3'));
Expected result:
----------------
this is the output returned:
bool(true)
bool(true)
bool(false)
which is expected, however, the "false" returned by the third call is
disingenuous... it is false because the call is being blocked by
open_basedir, and the following warning is triggered:
[Fri May 2 17:33:05 2008] [error] PHP Warning: file_exists():
open_basedir restriction in effect. File(/foo3) is not within the
allowed path(s)
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=44901&edit=1