Fix problem with searching files while the open_basedir is in use

This commit is contained in:
Florin Patan 2011-05-23 12:54:22 +00:00
parent 07401615a9
commit 06f74f8a39

View File

@ -41,7 +41,7 @@ class ExecutableFinder
*/
public function find($name, $default = null)
{
$dirs = explode(PATH_SEPARATOR, getenv('PATH') ? getenv('PATH') : getenv('Path'));
$dirs = explode(PATH_SEPARATOR, ini_get('open_basedir') ? ini_get('open_basedir') : (getenv('PATH') ? getenv('PATH') : getenv('Path')));
$suffixes = DIRECTORY_SEPARATOR == '\\' ? (getenv('PATHEXT') ? explode(PATH_SEPARATOR, getenv('PATHEXT')) : $this->suffixes) : array('');
foreach ($suffixes as $suffix) {
foreach ($dirs as $dir) {