mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-02 01:14:27 +02:00
Throw SmartyException when setting caching attributes for cacheable plugin as compiling this would fail.
Fixes #457
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
- fix foreachelse on arrayiterators https://github.com/smarty-php/smarty/issues/506
|
||||
- throw SmartyException when setting caching attributes for cacheable plugin https://github.com/smarty-php/smarty/issues/457
|
||||
|
||||
===== 3.1.34 release ===== 05.11.2019
|
||||
13.01.2020
|
||||
|
@@ -48,6 +48,8 @@ class Smarty_Internal_Method_RegisterPlugin
|
||||
throw new SmartyException("Plugin tag '{$name}' already registered");
|
||||
} elseif (!is_callable($callback)) {
|
||||
throw new SmartyException("Plugin '{$name}' not callable");
|
||||
} elseif ($cacheable && $cache_attr) {
|
||||
throw new SmartyException("Cannot set caching attributes for plugin '{$name}' when it is cacheable.");
|
||||
} else {
|
||||
$smarty->registered_plugins[ $type ][ $name ] = array($callback, (bool)$cacheable, (array)$cache_attr);
|
||||
}
|
||||
|
Reference in New Issue
Block a user