Skip to content

Commit

Permalink
- bugfix when {foreach} was looping over an object the total property…
Browse files Browse the repository at this point in the history
… like {$item@total} did always return 1 #281
  • Loading branch information
uwetews committed Sep 6, 2016
1 parent e5bbc05 commit 0429272
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
3 changes: 2 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
07.09.2016
- bugfix using nocache like attribute with value true like {plugin nocache=true} did not work https://github.com/smarty-php/smarty/issues/285
- bugfix uppercase TRUE, FALSE and NULL did not work when security was enabled https://github.com/smarty-php/smarty/issues/282

- bugfix when {foreach} was looping over an object the total property like {$item@total} did always return 1 https://github.com/smarty-php/smarty/issues/281

01.09.2016
- performance require_once should be called only once for shared plugins https://github.com/smarty-php/smarty/issues/280

Expand Down
2 changes: 1 addition & 1 deletion libs/Smarty.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ class Smarty extends Smarty_Internal_TemplateBase
/**
* smarty version
*/
const SMARTY_VERSION = '3.1.31-dev/10';
const SMARTY_VERSION = '3.1.31-dev/11';

/**
* define variable scopes
Expand Down
2 changes: 1 addition & 1 deletion libs/sysplugins/smarty_internal_runtime_foreach.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ public function count($value)
return 1;
}
} elseif (is_object($value)) {
return count($value);
return count((array)$value);
}
return 0;
}
Expand Down

0 comments on commit 0429272

Please sign in to comment.