invalid return of file_exists() in safe mode
| Bug #37987 | invalid return of file_exists() in safe mode | ||||
|---|---|---|---|---|---|
| Submitted: | 2006-07-02 13:31 UTC | Modified: | 2006-07-02 13:51 UTC | ||
| From: | tokul at users dot sourceforge dot net | Assigned: | |||
| Status: | Closed | Package: | Filesystem function related | ||
| PHP Version: | 5.1.4 | OS: | |||
| Private report: | No | CVE-ID: | None | ||
[2006-07-02 13:31 UTC] 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) ----
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2006-07-02 13:51 UTC] iliaa@php.net