Fixing plugin loading.

This commit is contained in:
andrey
2001-02-26 16:21:47 +00:00
parent 983c136047
commit 1305ada83a
2 changed files with 18 additions and 14 deletions

View File

@@ -76,12 +76,12 @@ class Smarty
var $tpl_file_ext = '.tpl'; // template file extention var $tpl_file_ext = '.tpl'; // template file extention
var $php_handling = SMARTY_PHP_PASSTHRU; // how smarty handles php tags var $php_handling = SMARTY_PHP_PASSTHRU; // how smarty handles php tags
// possible values: // possible values:
// SMARTY_PHP_PASSTHRU -> echo tags as is // SMARTY_PHP_PASSTHRU -> echo tags as is
// SMARTY_PHP_QUOTE -> escape tags as entities // SMARTY_PHP_QUOTE -> escape tags as entities
// SMARTY_PHP_REMOVE -> remove php tags // SMARTY_PHP_REMOVE -> remove php tags
// SMARTY_PHP_ALLOW -> execute php tags // SMARTY_PHP_ALLOW -> execute php tags
// default: SMARTY_PHP_PASSTHRU // default: SMARTY_PHP_PASSTHRU
var $left_delimiter = '{'; // template tag delimiters. var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}'; var $right_delimiter = '}';
@@ -1256,13 +1256,15 @@ class Smarty
if (!is_dir($this->plugin_dir)) if (!is_dir($this->plugin_dir))
return false; return false;
$included_files = implode(',', get_included_files());
$dir_handle = opendir($this->plugin_dir); $dir_handle = opendir($this->plugin_dir);
while ($entry = readdir($dir_handle)) { while ($entry = readdir($dir_handle)) {
$plugin_file = $this->plugin_dir.'/'.$entry; $plugin_file = $this->plugin_dir.'/'.$entry;
if ($entry == '.' || $entry == '..' || if ($entry == '.' || $entry == '..' ||
!is_file($plugin_file) || !is_file($plugin_file) ||
substr($plugin_file, -11) != '.plugin.php') substr($plugin_file, -11) != '.plugin.php' ||
strpos($included_files, $entry) !== false)
continue; continue;
unset($smarty_plugin_info); unset($smarty_plugin_info);

View File

@@ -76,12 +76,12 @@ class Smarty
var $tpl_file_ext = '.tpl'; // template file extention var $tpl_file_ext = '.tpl'; // template file extention
var $php_handling = SMARTY_PHP_PASSTHRU; // how smarty handles php tags var $php_handling = SMARTY_PHP_PASSTHRU; // how smarty handles php tags
// possible values: // possible values:
// SMARTY_PHP_PASSTHRU -> echo tags as is // SMARTY_PHP_PASSTHRU -> echo tags as is
// SMARTY_PHP_QUOTE -> escape tags as entities // SMARTY_PHP_QUOTE -> escape tags as entities
// SMARTY_PHP_REMOVE -> remove php tags // SMARTY_PHP_REMOVE -> remove php tags
// SMARTY_PHP_ALLOW -> execute php tags // SMARTY_PHP_ALLOW -> execute php tags
// default: SMARTY_PHP_PASSTHRU // default: SMARTY_PHP_PASSTHRU
var $left_delimiter = '{'; // template tag delimiters. var $left_delimiter = '{'; // template tag delimiters.
var $right_delimiter = '}'; var $right_delimiter = '}';
@@ -1256,13 +1256,15 @@ class Smarty
if (!is_dir($this->plugin_dir)) if (!is_dir($this->plugin_dir))
return false; return false;
$included_files = implode(',', get_included_files());
$dir_handle = opendir($this->plugin_dir); $dir_handle = opendir($this->plugin_dir);
while ($entry = readdir($dir_handle)) { while ($entry = readdir($dir_handle)) {
$plugin_file = $this->plugin_dir.'/'.$entry; $plugin_file = $this->plugin_dir.'/'.$entry;
if ($entry == '.' || $entry == '..' || if ($entry == '.' || $entry == '..' ||
!is_file($plugin_file) || !is_file($plugin_file) ||
substr($plugin_file, -11) != '.plugin.php') substr($plugin_file, -11) != '.plugin.php' ||
strpos($included_files, $entry) !== false)
continue; continue;
unset($smarty_plugin_info); unset($smarty_plugin_info);