diff --git a/change_log.txt b/change_log.txt index aa19638c..cb7a7347 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,6 +1,8 @@ ===== 3.1.31-dev ===== (xx.xx.xx) 14.08.2016 - bugfix $smarty_>debugging = true; did E_NOTICE messages when {eval} tag was used https://github.com/smarty-php/smarty/issues/266 + - bugfix Class 'Smarty_Internal_Runtime_ValidateCompiled' not found when upgrading from some older Smarty versions with existing + compiled or cached template files https://github.com/smarty-php/smarty/issues/269 ===== 3.1.30 ===== (07.08.2016) diff --git a/libs/Smarty.class.php b/libs/Smarty.class.php index b6ba2685..7702e02e 100644 --- a/libs/Smarty.class.php +++ b/libs/Smarty.class.php @@ -121,7 +121,7 @@ class Smarty extends Smarty_Internal_TemplateBase /** * smarty version */ - const SMARTY_VERSION = '3.1.31-dev/2'; + const SMARTY_VERSION = '3.1.31-dev/3'; /** * define variable scopes diff --git a/libs/sysplugins/smarty_internal_extension_handler.php b/libs/sysplugins/smarty_internal_extension_handler.php index edeb3958..bda8e82a 100644 --- a/libs/sysplugins/smarty_internal_extension_handler.php +++ b/libs/sysplugins/smarty_internal_extension_handler.php @@ -10,15 +10,20 @@ * @subpackage PluginsInternal * @author Uwe Tews * - * @property Smarty_Internal_Runtime_TplFunction $_tplFunction - * @property Smarty_Internal_Runtime_Foreach $_foreach - * @property Smarty_Internal_Runtime_WriteFile $_writeFile + * Runtime extensions + * @property Smarty_Internal_Runtime_CacheModify $_cacheModify + * @property Smarty_Internal_Runtime_Capture $_capture * @property Smarty_Internal_Runtime_CodeFrame $_codeFrame * @property Smarty_Internal_Runtime_FilterHandler $_filterHandler + * @property Smarty_Internal_Runtime_Foreach $_foreach * @property Smarty_Internal_Runtime_GetIncludePath $_getIncludePath - * @property Smarty_Internal_Runtime_UpdateScope $_updateScope - * @property Smarty_Internal_Runtime_CacheModify $_cacheModify + * @property Smarty_Internal_Runtime_Make_Nocache $_make_nocache * @property Smarty_Internal_Runtime_UpdateCache $_updateCache + * @property Smarty_Internal_Runtime_UpdateScope $_updateScope + * @property Smarty_Internal_Runtime_TplFunction $_tplFunction + * @property Smarty_Internal_Runtime_WriteFile $_writeFile + * + * Method extensions * @property Smarty_Internal_Method_GetTemplateVars $getTemplateVars * @property Smarty_Internal_Method_Append $append * @property Smarty_Internal_Method_AppendByRef $appendByRef @@ -64,6 +69,7 @@ class Smarty_Internal_Extension_Handler if (!isset($smarty->ext->$name)) { $class = 'Smarty_Internal_Method_' . ucfirst($name); if (preg_match('/^(set|get)([A-Z].*)$/', $name, $match)) { + $pn = ''; if (!isset($this->_property_info[ $prop = $match[ 2 ] ])) { // convert camel case to underscored name $this->resolvedProperties[ $prop ] = $pn = strtolower(join('_', @@ -127,6 +133,9 @@ class Smarty_Internal_Extension_Handler } else { $class = 'Smarty_Internal_Method_' . ucfirst($property_name); } + if (!class_exists($class)) { + return $this->$property_name = new Smarty_Internal_Undefined($class); + } return $this->$property_name = new $class(); } diff --git a/libs/sysplugins/smarty_internal_undefined.php b/libs/sysplugins/smarty_internal_undefined.php index 23563e05..d6f4bf62 100644 --- a/libs/sysplugins/smarty_internal_undefined.php +++ b/libs/sysplugins/smarty_internal_undefined.php @@ -1,9 +1,9 @@ class = $class; + } + + /** + * Wrapper for obsolete class Smarty_Internal_Runtime_ValidateCompiled * * @param \Smarty_Internal_Template $tpl * @param array $properties special template properties * @param bool $cache flag if called from cache file * - * @return bool flag if compiled or cache file is valid + * @return bool false */ public function decodeProperties(Smarty_Internal_Template $tpl, $properties, $cache = false) { @@ -44,6 +59,10 @@ class Smarty_Internal_Undefined */ public function __call($name, $args) { - throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method"); + if (isset($this->class)) { + throw new SmartyException("undefined extension class '{$this->class}'"); + } else { + throw new SmartyException(get_class($args[ 0 ]) . "->{$name}() undefined method"); + } } } \ No newline at end of file