projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
7bc07dc
)
- fix property access when the instance implements Iterator or similar cases, by...
author
Pierre Joye
<pierre.php@gmail.com>
Mon, 21 Nov 2011 13:02:02 +0000 (14:02 +0100)
committer
Pierre Joye
<pierre.php@gmail.com>
Mon, 21 Nov 2011 13:02:02 +0000 (14:02 +0100)
lib/Twig/Template.php
patch
|
blob
|
history
diff --git
a/lib/Twig/Template.php
b/lib/Twig/Template.php
index
f05c9b0
..
3207269
100644
(file)
--- a/
lib/Twig/Template.php
+++ b/
lib/Twig/Template.php
@@
-357,9
+357,11
@@
abstract class Twig_Template implements Twig_TemplateInterface
// object property
if (Twig_TemplateInterface::METHOD_CALL !== $type) {
if (!isset(self::$cache[$class]['properties'])) {
- foreach ($object as $k => $v) {
- self::$cache[$class]['properties'][$k] = true;
+ $props = get_object_vars($object);
+ foreach ($props as &$v) {
+ $v = true;
}
+ self::$cache[$class]['properties'] = $props;
}
if (isset(self::$cache[$class]['properties'][$item])