Bug #66084 [Csd]: simplexml_load_string() mangles empty node name

From: Date: Wed, 07 Oct 2015 14:37:14 +0000
Subject: Bug #66084 [Csd]: simplexml_load_string() mangles empty node name
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196454@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=66084&edit=1 ID: 66084 Updated by: ab@php.net Reported by: php at kenman dot net Summary: simplexml_load_string() mangles empty node name Status: Closed Type: Bug Package: SimpleXML related Operating System: Win7 PHP Version: 5.5Git-2013-11-12 (snap) Assigned To: ab Block user comment: N Private report: N New Comment: @bjcardon, but your snippets show that it is fixed. The initial report, as well as why the ticket was reopened, is that numeric indexes was used instead of the actual tag names. This is fixed. If you think there's another issue, please open another ticket. Thanks. Previous Comments: ------------------------------------------------------------------------ [2015-10-06 19:51:39] bjcardon at gmail dot com When was this bug "fixed" then in backports? It does not seem to be fixed in 5.6.11... php > var_dump(simplexml_load_string('<one><two><three> </three></two></one>')); object(SimpleXMLElement)#1 (1) { ["two"]=> object(SimpleXMLElement)#2 (1) { ["three"]=> object(SimpleXMLElement)#3 (1) { [0]=> string(3) " " } } } php > var_dump(simplexml_load_string('<one><two><three>somevalue</three></two></one>')); object(SimpleXMLElement)#1 (1) { ["two"]=> object(SimpleXMLElement)#2 (1) { ["three"]=> string(9) "somevalue" } } php > var_dump(new SimpleXmlElement('<one><two><three>somevalue</three></two></one>')); object(SimpleXMLElement)#1 (1) { ["two"]=> object(SimpleXMLElement)#2 (1) { ["three"]=> string(9) "somevalue" } } php > var_dump(new SimpleXmlElement('<one><two><three> </three></two></one>')); object(SimpleXMLElement)#1 (1) { ["two"]=> object(SimpleXMLElement)#2 (1) { ["three"]=> object(SimpleXMLElement)#3 (1) { [0]=> string(3) " " } } } ------------------------------------------------------------------------ [2015-05-30 12:29:18] cmb@php.net Thanks for merging, Anatol. The backports are fine (manual code review + running the simplexml test suite). I'll have a closer look at the non-passing tests. ------------------------------------------------------------------------ [2015-05-29 19:26:34] ab@php.net Hi Christoph, I've merged this into master. git am went not good, but patch worked while backporting to 5.5. Please do some check on that. Maybe you were up to check those test fails that were persisting till now? If so, please just use another PR ;) Thanks. ------------------------------------------------------------------------ [2015-05-28 09:57:40] cmb@php.net Hi Anatol, would cherry-picking the relevant commtis be an option? Or maybe just merging all commits and resolving the conflict of 18f9589 by rejecting? I can also make a separate PR for PHP 5, but then there is most likely no direct "link" between the commits, to easily follow later. Another option might be to rework the PR, so that there are only two commits (the first one for all versions, the second one for master only). Please let me know what you prefer. ------------------------------------------------------------------------ [2015-05-27 21:38:32] ab@php.net Hi Christoph, the PR looks fine, I'll merge it within days. How would you suggest to backport for 5.5 and 5.6? I guess reverting 18f9589 were enough? or maybe you could create a separate PR for 5.5? Thanks. ------------------------------------------------------------------------ The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=66084 -- Edit this bug report at https://bugs.php.net/bug.php?id=66084&edit=1

« previous php.bugs (#196454) next »