fixed a regression introduced by aa6b835816

This commit is contained in:
Fabien Potencier
2012-05-16 16:18:48 +02:00
parent c35e16dbd3
commit 8ec73cf475
6 changed files with 21 additions and 6 deletions
+2 -2
View File
@@ -1,6 +1,6 @@
* 1.9.0 (2012-XX-XX)
* 1.8.1 (2012-XX-XX)
* n/a
* fixed a regression when dealing with SimpleXMLElement instances in templates
* 1.8.0 (2012-05-08)
+1 -1
View File
@@ -25,7 +25,7 @@
},
"extra": {
"branch-alias": {
"dev-master": "1.9-dev"
"dev-master": "1.8-dev"
}
}
}
+1 -1
View File
@@ -15,7 +15,7 @@
#ifndef PHP_TWIG_H
#define PHP_TWIG_H
#define PHP_TWIG_VERSION "1.9.0-DEV"
#define PHP_TWIG_VERSION "1.8.1-DEV"
#include "php.h"
+1 -1
View File
@@ -17,7 +17,7 @@
*/
class Twig_Environment
{
const VERSION = '1.9.0-DEV';
const VERSION = '1.8.1-DEV';
protected $charset;
protected $loader;
+1 -1
View File
@@ -326,7 +326,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
*/
protected function getAttribute($object, $item, array $arguments = array(), $type = Twig_TemplateInterface::ANY_CALL, $isDefinedTest = false, $ignoreStrictCheck = false)
{
$item = (string) $item;
$item = is_numeric($item) ? (int) $item : (string) $item;
// array
if (Twig_TemplateInterface::METHOD_CALL !== $type) {
@@ -0,0 +1,15 @@
--TEST--
Twig is able to deal with SimpleXMLElement instances as variables
--TEMPLATE--
Hello '{{ images.image.0.group }}'!
{{ images.children().count() }}
{% for image in images %}
- {{ image.group }}
{% endfor %}
--DATA--
return array('images' => new SimpleXMLElement('<images><image><group>foo</group></image><image><group>bar</group></image></images>'))
--EXPECT--
Hello 'foo'!
2
- foo
- bar