mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
fixed typecasting for arrays in _parse_resource_name()
This commit is contained in:
@@ -1727,8 +1727,12 @@ 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
|
||||
$_resource_base_path = isset($params['resource_base_path']) ? $params['resource_base_path'] : array($this->template_dir, '.');
|
||||
settype($_resource_base_path, 'array');
|
||||
if (isset($params['resource_base_path'])) {
|
||||
$_resource_base_path = (array)$params['resource_base_path'];
|
||||
} else {
|
||||
$_resource_base_path = (array)$this->template_dir;
|
||||
$_resource_base_path[] = '.';
|
||||
}
|
||||
foreach ($_resource_base_path as $_curr_path) {
|
||||
$_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
|
||||
if (file_exists($_fullpath) && is_file($_fullpath)) {
|
||||
|
Reference in New Issue
Block a user