mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-06 03:14:27 +02:00
-bugfix of ArrayAccess object handling in internal _count() method
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== SVN trunk =====
|
===== SVN trunk =====
|
||||||
|
16/01/2011
|
||||||
|
-bugfix of ArrayAccess object handling in internal _count() method
|
||||||
|
|
||||||
14/01/2011
|
14/01/2011
|
||||||
-bugfix removed memory leak while processing compileAllTemplates
|
-bugfix removed memory leak while processing compileAllTemplates
|
||||||
|
|
||||||
|
@@ -276,12 +276,13 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
}
|
}
|
||||||
// release objects to free memory
|
// release objects to free memory
|
||||||
Smarty_Internal_TemplateCompilerBase::$_tag_objects = array();
|
Smarty_Internal_TemplateCompilerBase::$_tag_objects = array();
|
||||||
$this->compiler_object->parser->root_buffer = null;
|
unset($this->compiler_object->parser->root_buffer,
|
||||||
$this->compiler_object->parser->current_buffer = null;
|
$this->compiler_object->parser->current_buffer,
|
||||||
$this->compiler_object->parser = null;
|
$this->compiler_object->parser,
|
||||||
$this->compiler_object->lex = null;
|
$this->compiler_object->lex,
|
||||||
$this->compiler_object->template = null;
|
$this->compiler_object->template,
|
||||||
$this->compiler_object = null;
|
$this->compiler_object
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -860,10 +861,6 @@ class Smarty_Internal_Template extends Smarty_Internal_Data {
|
|||||||
{
|
{
|
||||||
if (is_array($value) === true || $value instanceof Countable) {
|
if (is_array($value) === true || $value instanceof Countable) {
|
||||||
return count($value);
|
return count($value);
|
||||||
} elseif ($value instanceof ArrayAccess) {
|
|
||||||
if ($value->offsetExists(0)) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
} elseif ($value instanceof Iterator) {
|
} elseif ($value instanceof Iterator) {
|
||||||
$value->rewind();
|
$value->rewind();
|
||||||
if ($value->valid()) {
|
if ($value->valid()) {
|
||||||
|
Reference in New Issue
Block a user