- remove redundant code

This commit is contained in:
Uwe Tews
2015-06-28 15:45:50 +02:00
parent 8d30442450
commit 99fe8120c8
3 changed files with 4 additions and 16 deletions

View File

@@ -49,8 +49,6 @@ class Smarty_Internal_Extension_LoadPlugin
// plugin filename is expected to be: [type].[name].php
$_plugin_filename = "{$_name_parts[1]}.{$_name_parts[2]}.php";
$_stream_resolve_include_path = function_exists('stream_resolve_include_path');
// loop through plugin dirs and find the plugin
foreach ($smarty->getPluginsDir() as $_plugin_dir) {
$names = array($_plugin_dir . $_plugin_filename, $_plugin_dir . strtolower($_plugin_filename),);
@@ -61,15 +59,9 @@ class Smarty_Internal_Extension_LoadPlugin
}
if ($smarty->use_include_path && !preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $_plugin_dir)) {
// try PHP include_path
if ($_stream_resolve_include_path) {
$file = stream_resolve_include_path($file);
} else {
$file = Smarty_Internal_Get_Include_Path::getIncludePath($file);
}
$file = Smarty_Internal_Get_Include_Path::getIncludePath($file);
if ($file !== false) {
require_once($file);
return $file;
}
}