* fixed the conversion of the special '0000-00-00 00:00' date
* added an error message when trying to import an undefined block from a trait
+ * fixed a C extension crash when accessing defined but uninitialized property.
* 1.15.0 (2013-12-06)
#else
tmp = Z_OBJ_HT_P(object)->read_property(object, propname, BP_VAR_IS TSRMLS_CC);
#endif
- if (tmp != EG(uninitialized_zval_ptr)) {
- return tmp;
- } else {
- return NULL;
+ if (tmp == EG(uninitialized_zval_ptr)) {
+ ZVAL_NULL(tmp);
}
}
return tmp;
$propertyObject = new Twig_TemplatePropertyObject();
$propertyObject1 = new Twig_TemplatePropertyObjectAndIterator();
$propertyObject2 = new Twig_TemplatePropertyObjectAndArrayAccess();
+ $propertyObject3 = new Twig_TemplatePropertyObjectDefinedWithUndefinedValue();
$methodObject = new Twig_TemplateMethodObject();
$magicMethodObject = new Twig_TemplateMagicMethodObject();
}
}
+ // additional properties tests
+ $tests = array_merge($tests, array(
+ array(true, null, $propertyObject3, 'foo', array(), $anyType),
+ ));
+
// additional method tests
$tests = array_merge($tests, array(
array(true, 'defined', $methodObject, 'defined', array(), $methodType),
}
}
+class Twig_TemplatePropertyObjectDefinedWithUndefinedValue
+{
+ public $foo;
+
+ public function __construct()
+ {
+ $this->foo = @$notExist;
+ }
+}
+
class Twig_TemplateMethodObject
{
public function getDefined()