only loop through relative paths for PHP include_path, remove $_relative variable

This commit is contained in:
mohrt
2002-06-27 14:30:43 +00:00
parent b854516e35
commit 0937caee0a
2 changed files with 6 additions and 12 deletions

View File

@@ -1674,14 +1674,11 @@ function _run_insert_handler($args)
// see if path is relative // see if path is relative
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
$_relative = true; $_relative_paths[] = $_plugin_dir;
// relative path, see if it is in the SMARTY_DIR // relative path, see if it is in the SMARTY_DIR
if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
return SMARTY_DIR . $_plugin_filepath; return SMARTY_DIR . $_plugin_filepath;
} }
} else {
// absolute path
$_relative = false;
} }
// try relative to cwd (or absolute) // try relative to cwd (or absolute)
if (@is_readable($_plugin_filepath)) { if (@is_readable($_plugin_filepath)) {
@@ -1690,8 +1687,8 @@ function _run_insert_handler($args)
} }
// still not found, try PHP include_path // still not found, try PHP include_path
if($_relative) { if(isset($_relative_paths)) {
foreach ((array)$this->plugins_dir as $_plugin_dir) { foreach ((array)$_relative_paths as $_plugin_dir) {
$_plugin_filepath = $_plugin_dir . DIR_SEP . $_plugin_filename; $_plugin_filepath = $_plugin_dir . DIR_SEP . $_plugin_filename;

View File

@@ -1674,14 +1674,11 @@ function _run_insert_handler($args)
// see if path is relative // see if path is relative
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
$_relative = true; $_relative_paths[] = $_plugin_dir;
// relative path, see if it is in the SMARTY_DIR // relative path, see if it is in the SMARTY_DIR
if (@is_readable(SMARTY_DIR . $_plugin_filepath)) { if (@is_readable(SMARTY_DIR . $_plugin_filepath)) {
return SMARTY_DIR . $_plugin_filepath; return SMARTY_DIR . $_plugin_filepath;
} }
} else {
// absolute path
$_relative = false;
} }
// try relative to cwd (or absolute) // try relative to cwd (or absolute)
if (@is_readable($_plugin_filepath)) { if (@is_readable($_plugin_filepath)) {
@@ -1690,8 +1687,8 @@ function _run_insert_handler($args)
} }
// still not found, try PHP include_path // still not found, try PHP include_path
if($_relative) { if(isset($_relative_paths)) {
foreach ((array)$this->plugins_dir as $_plugin_dir) { foreach ((array)$_relative_paths as $_plugin_dir) {
$_plugin_filepath = $_plugin_dir . DIR_SEP . $_plugin_filename; $_plugin_filepath = $_plugin_dir . DIR_SEP . $_plugin_filename;