From 0a0c6896d49a0c69f7c9a4b3d3f7ff7823e6cf29 Mon Sep 17 00:00:00 2001 From: andrei Date: Mon, 15 Apr 2002 19:32:54 +0000 Subject: [PATCH] Fixed _get_php_resource() to take include_path into account. --- Smarty.class.php | 11 +++++++++-- libs/Smarty.class.php | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/Smarty.class.php b/Smarty.class.php index df36f586..054ded06 100644 --- a/Smarty.class.php +++ b/Smarty.class.php @@ -755,10 +755,17 @@ function _generate_debug_output() { * Find out if the resource exists. */ - $readable = true; - if ($resource_type == 'file' && !@is_file($resource_name)) { + if ($resource_type == 'file') { $readable = false; + $include_paths = preg_split('![:;]!', ini_get('include_path')); + foreach ($include_paths as $path) { + if (@is_file($path . DIRECTORY_SEPARATOR . $resource_name)) { + $readable = true; + break; + } + } } else if ($resource_type != 'file') { + $readable = true; $resource_func = $this->_plugins['resource'][$resource_type][0][0]; $readable = $resource_func($resource_name, $template_source, $this); } diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index df36f586..054ded06 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -755,10 +755,17 @@ function _generate_debug_output() { * Find out if the resource exists. */ - $readable = true; - if ($resource_type == 'file' && !@is_file($resource_name)) { + if ($resource_type == 'file') { $readable = false; + $include_paths = preg_split('![:;]!', ini_get('include_path')); + foreach ($include_paths as $path) { + if (@is_file($path . DIRECTORY_SEPARATOR . $resource_name)) { + $readable = true; + break; + } + } } else if ($resource_type != 'file') { + $readable = true; $resource_func = $this->_plugins['resource'][$resource_type][0][0]; $readable = $resource_func($resource_name, $template_source, $this); }