mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
Fixing plugin loading.
This commit is contained in:
@@ -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);
|
||||||
|
@@ -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);
|
||||||
|
Reference in New Issue
Block a user