From 5a37e025ae583b24163992d3f1e300370e4b845f Mon Sep 17 00:00:00 2001 From: messju Date: Thu, 18 Mar 2004 07:05:29 +0000 Subject: [PATCH] moved setting of a default resource_base_path from Smarty::_parse_resource_name() to Smarty::_fetch_resource_info() this shouldn't affect anything, since all calls to _parse_resource_name() that are not done from within _fetch_resource_info() all pass their own resource_base_path --- libs/Smarty.class.php | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index 55e432f7..8f2651e5 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -1535,6 +1535,8 @@ class Smarty $_params = array('resource_name' => $params['resource_name']) ; if (isset($params['resource_base_path'])) $_params['resource_base_path'] = $params['resource_base_path']; + else + $_params['resource_base_path'] = $this->template_dir; if ($this->_parse_resource_name($_params)) { $_resource_type = $_params['resource_type']; @@ -1633,12 +1635,7 @@ class Smarty if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $params['resource_name'])) { // relative pathname to $params['resource_base_path'] // use the first directory where the file is found - if (isset($params['resource_base_path'])) { - $_resource_base_path = (array)$params['resource_base_path']; - } else { - $_resource_base_path = (array)$this->template_dir; - } - foreach ($_resource_base_path as $_curr_path) { + foreach ((array)$params['resource_base_path'] as $_curr_path) { $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name']; if (file_exists($_fullpath) && is_file($_fullpath)) { $params['resource_name'] = $_fullpath;