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

From: Date: Tue, 06 Oct 2015 19:51:40 +0000
Subject: Bug #66084 [Com]: simplexml_load_string() mangles empty node name
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-196436@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
 Comment by:         bjcardon at gmail dot com
 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:

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) "   "
    }
  }
}


Previous Comments:
------------------------------------------------------------------------
[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.

------------------------------------------------------------------------
[2015-05-27 18:24:18] cmb@php.net

I've submitted the PR: <https://github.com/php/php-src/pull/1306>.
Please have a look at it, Anatol.

------------------------------------------------------------------------


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


Thread (23 messages)

« previous php.bugs (#196436) next »