- bugfix {foreach} compilation failed when $smarty->merge_compiled_includes = true and pre-filters are used.

https://github.com/smarty-php/smarty/issues/172
This commit is contained in:
uwetews
2016-02-01 00:46:15 +01:00
parent e1bf16a504
commit 85eedd0c11
3 changed files with 7 additions and 7 deletions

View File

@@ -1,4 +1,7 @@
 ===== 3.1.30-dev ===== (xx.xx.xx)  ===== 3.1.30-dev ===== (xx.xx.xx)
01.02.2016
- bugfix {foreach} compilation failed when $smarty->merge_compiled_includes = true and pre-filters are used.
29.01.2016 29.01.2016
- bugfix implement replacement code for _tag_stack property https://github.com/smarty-php/smarty/issues/151 - bugfix implement replacement code for _tag_stack property https://github.com/smarty-php/smarty/issues/151

View File

@@ -175,7 +175,7 @@ class Smarty_Internal_Compile_Private_ForeachSection extends Smarty_Internal_Com
// run pre filter if required // run pre filter if required
if ((isset($nextCompiler->smarty->autoload_filters['pre']) || if ((isset($nextCompiler->smarty->autoload_filters['pre']) ||
isset($nextCompiler->smarty->registered_filters['pre']))) { isset($nextCompiler->smarty->registered_filters['pre']))) {
$_content = $nextCompiler->smarty->ext->_filter_Handler->runFilter('pre', $_content, $nextCompiler->template); $_content = $nextCompiler->smarty->ext->_filterHandler->runFilter('pre', $_content, $nextCompiler->template);
} }
$this->matchProperty($_content); $this->matchProperty($_content);
} }

View File

@@ -123,15 +123,12 @@ class Smarty_Internal_Extension_Handler
public function __get($property_name) public function __get($property_name)
{ {
// object properties of runtime template extensions will start with '_' // object properties of runtime template extensions will start with '_'
if ($property_name[0] == '_') { if ($property_name[ 0 ] == '_') {
$class = 'Smarty_Internal_Runtime_' . ucfirst(substr($property_name, 1)); $class = 'Smarty_Internal_Runtime_' . ucfirst(substr($property_name, 1));
} else { } else {
$class = 'Smarty_Internal_Method_' . ucfirst($property_name); $class = 'Smarty_Internal_Method_' . ucfirst($property_name);
} }
if (class_exists($class)) { return $this->$property_name = new $class();
return $this->$property_name = new $class();
}
return $this;
} }
/** /**
@@ -145,7 +142,7 @@ class Smarty_Internal_Extension_Handler
*/ */
public function __call($name, $args) public function __call($name, $args)
{ {
return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), $args); return call_user_func_array(array(new Smarty_Internal_Undefined(), $name), array($this));
} }
} }