-bugfix of ArrayAccess object handling in internal _count() method

This commit is contained in:
uwe.tews@googlemail.com
2011-01-16 15:28:43 +00:00
parent cfd81bafba
commit 7dfb27d322
2 changed files with 10 additions and 10 deletions

View File

@@ -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

View File

@@ -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()) {