|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2006-10-29 09:52 UTC] judas dot iscariote at gmail dot com
Description:
------------
is_readable is raising and open_basedir warrning when the file/dir is not in open_basedir.
this is not expected or at least is not mentioned in the documentation.
Reproduce code:
---------------
php -d display_errors=1 -dopen_basedir=`pwd` -r 'var_dump(is_readable("/tmp"));'
Expected result:
----------------
a silent
bool(false)
as stated on the documentation.
Actual result:
--------------
Warning: is_readable(): open_basedir restriction in effect. File(/tmp) is not within the allowed path(s):
bool(false)
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Nov 14 08:00:01 2025 UTC |
it is silent in 4_4 , 4.3.9 this annoyance affects the whole stat() family. if this is considered a bug in the code here is my fix : --- ext/standard/filestat.c 2 Jul 2006 13:51:40 -0000 1.136.2.8.2.3 +++ ext/standard/filestat.c 29 Oct 2006 23:45:54 -0000 @@ -660,7 +660,7 @@ } if ((wrapper = php_stream_locate_url_wrapper(filename, &local, 0 TSRMLS_CC)) == &php_plain_files_wrapper) { - if (php_check_open_basedir(local TSRMLS_CC) || (PG(safe_mode) && !php_checkuid_ex(filename, NULL, CHECKUID_ALLOW_FILE_NOT_EXISTS, CHECKUID_NO_ERRORS))) { + if (php_check_open_basedir_ex(local, 0 TSRMLS_CC) || (PG(safe_mode) && !php_checkuid_ex(filename, NULL, CHECKUID_ALLOW_FILE_NOT_EXISTS, CHECKUID_NO_ERRORS))) { RETURN_FALSE; } } this change was introduced in php 5.1.5 by Ilia. http://cvs.php.net/viewvc.cgi/php-src/ext/standard/filestat.c?r1=1.136.2.8&r2=1.136.2.9 it this is considered not to be a bug, please update the documentation ;)