mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 18:34:27 +02:00
only search include_path if relative path
This commit is contained in:
@@ -1674,17 +1674,22 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
|
||||||
// relative path
|
// relative path
|
||||||
|
$_relative = true;
|
||||||
$_plugin_filepath = SMARTY_DIR . $_plugin_filepath;
|
$_plugin_filepath = SMARTY_DIR . $_plugin_filepath;
|
||||||
|
} else {
|
||||||
|
$_relative = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@is_readable($_plugin_filepath)) {
|
if (@is_readable($_plugin_filepath)) {
|
||||||
return $_plugin_filepath;
|
return $_plugin_filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// didn't find it try include path
|
// didn't find it, try include path
|
||||||
if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) {
|
if($_relative) {
|
||||||
return $_include_filepath;
|
if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) {
|
||||||
}
|
return $_include_filepath;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
@@ -1674,17 +1674,22 @@ function _run_insert_handler($args)
|
|||||||
|
|
||||||
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
|
if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $_plugin_dir)) {
|
||||||
// relative path
|
// relative path
|
||||||
|
$_relative = true;
|
||||||
$_plugin_filepath = SMARTY_DIR . $_plugin_filepath;
|
$_plugin_filepath = SMARTY_DIR . $_plugin_filepath;
|
||||||
|
} else {
|
||||||
|
$_relative = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (@is_readable($_plugin_filepath)) {
|
if (@is_readable($_plugin_filepath)) {
|
||||||
return $_plugin_filepath;
|
return $_plugin_filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
// didn't find it try include path
|
// didn't find it, try include path
|
||||||
if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) {
|
if($_relative) {
|
||||||
return $_include_filepath;
|
if ($this->_get_include_path($_plugin_dir . DIR_SEP . $_plugin_filename, $_include_filepath)) {
|
||||||
}
|
return $_include_filepath;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user