Bug #69240 [Ver]: is_dir() warns of open_basedir restriction on non-existent directory in config
Edit report at https://bugs.php.net/bug.php?id=69240&edit=1
ID: 69240
Updated by: cmb@php.net
Reported by: andrea dot cristaudo at gmail dot com
Summary: is_dir() warns of open_basedir restriction on
non-existent directory in config
Status: Verified
Type: Bug
Package: Safe Mode/open_basedir
PHP Version: 5.5.22
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
Related to bug #52065.
Previous Comments:
------------------------------------------------------------------------
[2015-03-16 07:53:06] fa@php.net
Verified on 5.5.24-dev
Output on 5.6.4 is
bool(true)
bool(fals)
------------------------------------------------------------------------
[2015-03-15 10:01:29] andrea dot cristaudo at gmail dot com
Description:
------------
If open_basedir is active, file_exists(), as well as is_dir() and
is_file(), throw an open_basedir warning if you check a directory mentioned in the open_basedir
configuration if that directory is non-existent.
Same result on v5.5.9 and v.5.3.3 that I've tested on.
Somehow related to https://bugs.php.net/bug.php?id=41518 and https://bugs.php.net/bug.php?id=24313
Test script:
---------------
#php -d open_basedir=/tmp -r 'var_dump(is_dir("/tmp"));'
#php -d open_basedir=/tmp2 -r 'var_dump(is_dir("/tmp2"));'
Expected result:
----------------
bool(true)
bool(false)
Actual result:
--------------
bool(true)
PHP Warning: is_dir(): open_basedir restriction in effect. File(/tmp2) is not within the allowed
path(s): (/tmp2) in Command line code on line 1
PHP Stack trace:
PHP 1. {main}() Command line code:0
PHP 2. is_dir() Command line code:1
bool(false)
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=69240&edit=1
Thread (7 messages)