|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2007-09-02 00:20 UTC] php at ideacode dot com
Description:
------------
There are legitimate "secure-operation" situations when you want the include path wiped out, so that all included files must be explicitly stated.
The obvious way to set this is with either:
set_include_path(''); // or
ini_set('include_path', '');
However, neither one of these sets the include path to '' on the latest version of PHP 4 or PHP 5 in Linux.
A non-obvious workaround is to use a whitespace string:
set_include_path(' '); // or
ini_set('include_path', ' ');
which does set the path to ' ' (which hopefully isn't a valid directory!).
I believe passing a lambda string to either set_include_path or ini_set('include_path') should set the path to the lambda string.
http://bytejar.com/ - Software Lessons Learned the Hard Way
Reproduce code:
---------------
$original_path = set_include_path('');
Expected result:
----------------
'' === get_include_path();
Actual result:
--------------
$original_path === get_include_path();
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Dec 01 15:00:01 2025 UTC |
1. It seems that only setting at least 1 char "clears" the include_path. This can be tested with checking the (bool) result. Example: set_include_path(' '); 2. It seems that after setting or "unsetting" the include_path still ".:.." is active as path where PHP searches for files.