diff --git a/change_log.txt b/change_log.txt index 85f5ed99..2c628dd4 100644 --- a/change_log.txt +++ b/change_log.txt @@ -1,4 +1,7 @@ ===== SVN trunk ===== +16/01/2011 +-bugfix of ArrayAccess object handling in internal _count() method + 14/01/2011 -bugfix removed memory leak while processing compileAllTemplates diff --git a/libs/sysplugins/smarty_internal_template.php b/libs/sysplugins/smarty_internal_template.php index 3678a48c..2767f2bf 100644 --- a/libs/sysplugins/smarty_internal_template.php +++ b/libs/sysplugins/smarty_internal_template.php @@ -276,12 +276,13 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { } // release objects to free memory Smarty_Internal_TemplateCompilerBase::$_tag_objects = array(); - $this->compiler_object->parser->root_buffer = null; - $this->compiler_object->parser->current_buffer = null; - $this->compiler_object->parser = null; - $this->compiler_object->lex = null; - $this->compiler_object->template = null; - $this->compiler_object = null; + unset($this->compiler_object->parser->root_buffer, + $this->compiler_object->parser->current_buffer, + $this->compiler_object->parser, + $this->compiler_object->lex, + $this->compiler_object->template, + $this->compiler_object + ); } /** @@ -860,10 +861,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data { { if (is_array($value) === true || $value instanceof Countable) { return count($value); - } elseif ($value instanceof ArrayAccess) { - if ($value->offsetExists(0)) { - return 1; - } } elseif ($value instanceof Iterator) { $value->rewind(); if ($value->valid()) {