|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2012-08-14 11:57 UTC] cweiske@php.net
-Status: Open
+Status: Closed
-Package: Feature/Change Request
+Package: *General Issues
-Assigned To:
+Assigned To: cweiske
[2012-08-14 11:57 UTC] cweiske@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Nov 30 20:00:01 2025 UTC |
Description: ------------ Actually there is a difference between read and include authorization: I can't read a file, but, at the same time, I can include it (read about safe_mode_include_dir). Unfortunately there is no way to check if I can include a file or not. Actually the only way to do this is perform an include, and this is not always what we want to do. Reproduce code: --------------- function check_plugins($pluginsFromConfig) { foreach($pluginsFromConfig As $filepath) { if(is_includable($filepath)===false) { trigger_error('plugin not found',E_USER_ERROR); exit; } else echo 'plugin -bla- -bla- exists'; } } Expected result: ---------------- We expect to know if a file can be included, without include it. Actual result: -------------- Function is_includable doesn't exist. We tried to use file_exists, etc. but are limited by safe_mode restrictions. Documentation say that we can use is_readable for ignore safe_mode restriction but it doesn't work and if it will work it will be logically wrong.