mirror of
https://github.com/twigphp/Twig.git
synced 2026-09-13 10:56:38 +00:00
- fix property access when the instance implements Iterator or similar cases, by using get_object_vars instead, thx Arnaud Leblanc for the hint.
This commit is contained in:
@@ -357,9 +357,11 @@ abstract class Twig_Template implements Twig_TemplateInterface
|
|||||||
// object property
|
// object property
|
||||||
if (Twig_TemplateInterface::METHOD_CALL !== $type) {
|
if (Twig_TemplateInterface::METHOD_CALL !== $type) {
|
||||||
if (!isset(self::$cache[$class]['properties'])) {
|
if (!isset(self::$cache[$class]['properties'])) {
|
||||||
foreach ($object as $k => $v) {
|
$props = get_object_vars($object);
|
||||||
self::$cache[$class]['properties'][$k] = true;
|
foreach ($props as &$v) {
|
||||||
|
$v = true;
|
||||||
}
|
}
|
||||||
|
self::$cache[$class]['properties'] = $props;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset(self::$cache[$class]['properties'][$item])
|
if (isset(self::$cache[$class]['properties'][$item])
|
||||||
|
|||||||
Reference in New Issue
Block a user