fixed C ext

This commit is contained in:
Fabien Potencier
2018-03-02 09:40:18 -08:00
parent 64e856892b
commit a0c24242de
2 changed files with 8 additions and 2 deletions
+7 -1
View File
@@ -870,6 +870,8 @@ PHP_FUNCTION(twig_template_get_attributes)
if (null === $object) {
$message = sprintf('Impossible to invoke a method ("%s") on a null variable', $item);
} elseif (is_array($object)) {
$message = sprintf('Impossible to invoke a method ("%s") on an array.', $item);
} else {
$message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s")', $item, gettype($object), $object);
}
@@ -887,7 +889,11 @@ PHP_FUNCTION(twig_template_get_attributes)
if (Z_TYPE_P(object) == IS_NULL) {
convert_to_string_ex(&object);
TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a %s variable.", item, type_name);
TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on a null variable.", item);
} else if (Z_TYPE_P(object) == IS_ARRAY) {
convert_to_string_ex(&object);
TWIG_RUNTIME_ERROR(template TSRMLS_CC, "Impossible to invoke a method (\"%s\") on an array.", item);
} else {
convert_to_string_ex(&object);
+1 -1
View File
@@ -569,7 +569,7 @@ abstract class Twig_Template implements Twig_TemplateInterface
if (null === $object) {
$message = sprintf('Impossible to invoke a method ("%s") on a null variable.', $item);
} elseif (is_array($object)) {
$message = sprintf('Impossible to invoke a method ("%s") on an array.', $item);
$message = sprintf('Impossible to invoke a method ("%s") on an array.', $item);
} else {
$message = sprintf('Impossible to invoke a method ("%s") on a %s variable ("%s").', $item, gettype($object), $object);
}