From: paolo at schiro dot it
Operating system: Linux
PHP version: Irrelevant
Package: Safe Mode/open_basedir
Bug Type: Bug
Bug description:file_exists() warns of open_basedir on existing file mis-used
as directory
Description:
------------
When open_basedir set file_exists() raise an open_basedir warning
when checking a path which permitted by open_basedir but includes
an existent file misused as directory.
Test script:
---------------
//create a file
$fhandle = fopen('existing-file-which-is-not-dir.txt', 'w');
//throw your mind away and use it as a directory
if (is_file('existing-file-which-is-not-dir.txt/test.html')) {
print "File exists";
} else {
print "File does not exist";
}
//show the error
print_r(error_get_last());
Expected result:
----------------
is_file should return a FALSE and you should read "File does not exist".
Actual result:
--------------
In addition to "File does not exist", you'll get a warning that
open_basedir restriction is in effect:
--
Edit bug report at https://bugs.php.net/bug.php?id=65211&edit=1
--
Try a snapshot (PHP 5.4):
https://bugs.php.net/fix.php?id=65211&r=trysnapshot54
Try a snapshot (PHP 5.3):
https://bugs.php.net/fix.php?id=65211&r=trysnapshot53
Try a snapshot (trunk):
https://bugs.php.net/fix.php?id=65211&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=65211&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=65211&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=65211&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=65211&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=65211&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=65211&r=support
Expected behavior: https://bugs.php.net/fix.php?id=65211&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=65211&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=65211&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=65211&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65211&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=65211&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=65211&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=65211&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=65211&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=65211&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=65211&r=mysqlcfg