mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 11:24:27 +02:00
- bugfix added missing support of $cache_attrs for registered plugins
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
===== SVN trunk =====
|
===== SVN trunk =====
|
||||||
|
17/12/2010
|
||||||
|
- bugfix added missing support of $cache_attrs for registered plugins
|
||||||
|
|
||||||
15/12/2010
|
15/12/2010
|
||||||
- bugfix assigment as condition in {while} did drop an E_NOTICE
|
- bugfix assignment as condition in {while} did drop an E_NOTICE
|
||||||
|
|
||||||
14/12/2010
|
14/12/2010
|
||||||
- bugfix when passing an array as default parameter at {function} tag
|
- bugfix when passing an array as default parameter at {function} tag
|
||||||
|
@@ -41,6 +41,9 @@ class Smarty_Internal_Compile_Private_Registered_Block extends Smarty_Internal_C
|
|||||||
foreach ($_attr as $_key => $_value) {
|
foreach ($_attr as $_key => $_value) {
|
||||||
if (is_int($_key)) {
|
if (is_int($_key)) {
|
||||||
$_paramsArray[] = "$_key=>$_value";
|
$_paramsArray[] = "$_key=>$_value";
|
||||||
|
} elseif ($this->compiler->template->caching && in_array($_key,$compiler->smarty->registered_plugins[Smarty::PLUGIN_BLOCK][$tag][2])) {
|
||||||
|
$_value = str_replace("'","^#^",$_value);
|
||||||
|
$_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
|
||||||
} else {
|
} else {
|
||||||
$_paramsArray[] = "'$_key'=>$_value";
|
$_paramsArray[] = "'$_key'=>$_value";
|
||||||
}
|
}
|
||||||
|
@@ -43,6 +43,9 @@ class Smarty_Internal_Compile_Private_Registered_Function extends Smarty_Interna
|
|||||||
foreach ($_attr as $_key => $_value) {
|
foreach ($_attr as $_key => $_value) {
|
||||||
if (is_int($_key)) {
|
if (is_int($_key)) {
|
||||||
$_paramsArray[] = "$_key=>$_value";
|
$_paramsArray[] = "$_key=>$_value";
|
||||||
|
} elseif ($this->compiler->template->caching && in_array($_key,$compiler->smarty->registered_plugins[Smarty::PLUGIN_FUNCTION][$tag][2])) {
|
||||||
|
$_value = str_replace("'","^#^",$_value);
|
||||||
|
$_paramsArray[] = "'$_key'=>^#^.var_export($_value,true).^#^";
|
||||||
} else {
|
} else {
|
||||||
$_paramsArray[] = "'$_key'=>$_value";
|
$_paramsArray[] = "'$_key'=>$_value";
|
||||||
}
|
}
|
||||||
|
@@ -35,10 +35,7 @@ class Smarty_Internal_Register {
|
|||||||
} elseif (!is_callable($callback)) {
|
} elseif (!is_callable($callback)) {
|
||||||
throw new Exception("Plugin \"{$tag}\" not callable");
|
throw new Exception("Plugin \"{$tag}\" not callable");
|
||||||
} else {
|
} else {
|
||||||
$this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable);
|
$this->smarty->registered_plugins[$type][$tag] = array($callback, (bool) $cacheable, (array) $cache_attr);
|
||||||
if (isset($cache_attr)&&in_array($type, array(Smarty::PLUGIN_BLOCK, Smarty::PLUGIN_FUNCTION))) {
|
|
||||||
$this->smarty->registered_plugins[$type][$tag][] = (array) $cache_attr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -364,6 +364,7 @@ class Smarty_Internal_TemplateCompilerBase {
|
|||||||
($this->nocache || $this->tag_nocache || $this->template->forceNocache == 2)) {
|
($this->nocache || $this->tag_nocache || $this->template->forceNocache == 2)) {
|
||||||
$this->template->has_nocache_code = true;
|
$this->template->has_nocache_code = true;
|
||||||
$_output = str_replace("'", "\'", $content);
|
$_output = str_replace("'", "\'", $content);
|
||||||
|
$_output = str_replace("^#^", "'", $_output);
|
||||||
$_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>";
|
$_output = "<?php echo '/*%%SmartyNocache:{$this->nocache_hash}%%*/" . $_output . "/*/%%SmartyNocache:{$this->nocache_hash}%%*/';?>";
|
||||||
// make sure we include modifer plugins for nocache code
|
// make sure we include modifer plugins for nocache code
|
||||||
if (isset($this->template->saved_modifier)) {
|
if (isset($this->template->saved_modifier)) {
|
||||||
|
Reference in New Issue
Block a user