From: Marcus Boerger Date: Tue, 22 Jan 2008 20:42:22 +0000 (+0000) Subject: - MFH Bugfix #37076 (SimpleXML ignores .=). (felipe, marcus) X-Git-Tag: RELEASE_1_3_1~322 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10a0f206528fd123d75398fc4a44525d4bd54787;p=php - MFH Bugfix #37076 (SimpleXML ignores .=). (felipe, marcus) --- diff --git a/NEWS b/NEWS index 047af8cf28..547098df9e 100644 --- a/NEWS +++ b/NEWS @@ -126,6 +126,7 @@ PHP NEWS - Fixed bug #37964 (Reflection shows private methods of parent class). (Felipe, Marcus) - Fixed bug #37911 (preg_replace_callback() ignores named groups). (Nuno) +- Fixed bug #37076 (SimpleXML ignores .=). (Felipe, Marcus) - Fixed bug #36128 (Interbase PDO - timestamp columns return NULL). (Lars W) - Fixed bug #35386 (firebird: first row is null). (Lars W) - Fixed bug #35163 (Array elements can lose references). (Dmitry) diff --git a/ext/simplexml/simplexml.c b/ext/simplexml/simplexml.c index ff78d29a1f..336707c8ff 100644 --- a/ext/simplexml/simplexml.c +++ b/ext/simplexml/simplexml.c @@ -711,11 +711,13 @@ static zval** sxe_property_get_adr(zval *object, zval *member TSRMLS_DC) /* {{{ convert_to_string(member); name = Z_STRVAL_P(member); node = sxe_get_element_by_name(sxe, node, &name, &type TSRMLS_CC); - if (!node) { - sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); - type = SXE_ITER_NONE; - name = NULL; + if (node) { + return NULL; } + sxe_prop_dim_write(object, member, NULL, 1, 0, &node TSRMLS_CC); + type = SXE_ITER_NONE; + name = NULL; + MAKE_STD_ZVAL(return_value); _node_as_zval(sxe, node, return_value, type, name, sxe->iter.nsprefix, sxe->iter.isprefix TSRMLS_CC); diff --git a/ext/simplexml/tests/bug37076.phpt b/ext/simplexml/tests/bug37076.phpt new file mode 100644 index 0000000000..a5b3801ccb --- /dev/null +++ b/ext/simplexml/tests/bug37076.phpt @@ -0,0 +1,14 @@ +--TEST-- +Bug #37076 (SimpleXML ignores .=) +--FILE-- +"); +$xml->foo = "foo"; +$xml->foo .= "bar"; +print $xml->asXML(); +?> +===DONE=== +--EXPECT-- + +foobar +===DONE===