#37987 [Opn->Csd]: invalid return of file_exists() in safe mode
| From: | iliaa@php.net | Date: | Sun, 02 Jul 2006 13:51:52 +0000 |
| Subject: | #37987 [Opn->Csd]: invalid return of file_exists() in safe mode | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-99032@lists.php.net to get a copy of this message | ||
ID: 37987
Updated by: iliaa@php.net
Reported By: tokul at users dot sourceforge dot net
-Status: Open
+Status: Closed
Bug Type: Filesystem function related
PHP Version: 5.1.4
New Comment:
This bug has been fixed in CVS.
Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
Thank you for the report, and for helping us make PHP better.
Previous Comments:
------------------------------------------------------------------------
[2006-07-02 13:31:25] tokul at users dot sourceforge dot net
Description:
------------
PHP documentation (http://www.php.net/file-exists) states that
file_exists() function returns false, when file is inaccessible due to
safe mode restrictions.
Tested PHP 4.3.10, 4.4CVS (200607021030), 5.1.4 and
5.2CVS(200607021030).
In PHP 5.1.4 and 5.2CVS file_exists() function returns true, when file
exists, but is inaccessible due to safe mode restrictions. Other php
versions work as documented.
Reproduce code:
---------------
<?php
var_dump(ini_get('safe_mode'));
var_dump(file_exists('/usr/games/fortune'));
var_dump(is_file('/usr/games/fortune'));
var_dump(is_dir('/usr/games/fortune'));
?>
Expected result:
----------------
When safe_mode is on
----
string(1) "1"
bool(false)
bool(false)
bool(false)
----
When safe_mode is off
----
string(0) ""
bool(true)
bool(true)
bool(false)
----
Actual result:
--------------
When safe_mode is on
----
string(1) "1"
bool(true)
bool(false)
bool(false)
----
When safe_mode is off
----
string(0) ""
bool(true)
bool(true)
bool(false)
----
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=37987&edit=1