From ae93e0b65df7ce1c6a0b92d84aaa939ec3135760 Mon Sep 17 00:00:00 2001 From: mohrt Date: Wed, 26 Jun 2002 14:59:03 +0000 Subject: [PATCH] only search include_path if relative path --- Smarty.class.php | 13 +++++++++---- libs/Smarty.class.php | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index 8fcb45b5..ce211223 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -1674,17 +1674,22 @@ function _run_insert_handler($args) if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { // relative path + $_relative = true; $_plugin_filepath = SMARTY_DIR . $_plugin_filepath; + } else { + $_relative = false; } if (@is_readable($_plugin_filepath)) { return $_plugin_filepath; } - // didn't find it try include path - if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) { - return $_include_filepath; - } + // didn't find it, try include path + if($_relative) { + if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) { + return $_include_filepath; + } + } } return false; diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 8fcb45b5..ce211223 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1674,17 +1674,22 @@ function _run_insert_handler($args) if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) { // relative path + $_relative = true; $_plugin_filepath = SMARTY_DIR . $_plugin_filepath; + } else { + $_relative = false; } if (@is_readable($_plugin_filepath)) { return $_plugin_filepath; } - // didn't find it try include path - if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) { - return $_include_filepath; - } + // didn't find it, try include path + if($_relative) { + if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) { + return $_include_filepath; + } + } } return false;