mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
Fixed _get_php_resource() to take include_path into account.
This commit is contained in:
@@ -755,10 +755,17 @@ function _generate_debug_output() {
|
|||||||
* Find out if the resource exists.
|
* Find out if the resource exists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$readable = true;
|
if ($resource_type == 'file') {
|
||||||
if ($resource_type == 'file' && !@is_file($resource_name)) {
|
|
||||||
$readable = false;
|
$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') {
|
} else if ($resource_type != 'file') {
|
||||||
|
$readable = true;
|
||||||
$resource_func = $this->_plugins['resource'][$resource_type][0][0];
|
$resource_func = $this->_plugins['resource'][$resource_type][0][0];
|
||||||
$readable = $resource_func($resource_name, $template_source, $this);
|
$readable = $resource_func($resource_name, $template_source, $this);
|
||||||
}
|
}
|
||||||
|
@@ -755,10 +755,17 @@ function _generate_debug_output() {
|
|||||||
* Find out if the resource exists.
|
* Find out if the resource exists.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
$readable = true;
|
if ($resource_type == 'file') {
|
||||||
if ($resource_type == 'file' && !@is_file($resource_name)) {
|
|
||||||
$readable = false;
|
$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') {
|
} else if ($resource_type != 'file') {
|
||||||
|
$readable = true;
|
||||||
$resource_func = $this->_plugins['resource'][$resource_type][0][0];
|
$resource_func = $this->_plugins['resource'][$resource_type][0][0];
|
||||||
$readable = $resource_func($resource_name, $template_source, $this);
|
$readable = $resource_func($resource_name, $template_source, $this);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user