php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67909 simplexml_load_string() mangles empty node name for specific xml structure
Submitted: 2014-08-26 15:24 UTC Modified: 2016-11-30 18:54 UTC
Votes:5
Avg. Score:3.6 ± 0.8
Reproduced:4 of 5 (80.0%)
Same Version:2 (50.0%)
Same OS:2 (50.0%)
From: evgeniy dot arsenyev at gmail dot com Assigned: cmb (profile)
Status: Duplicate Package: SimpleXML related
PHP Version: 5.5.16 OS: CENTOS 7
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: evgeniy dot arsenyev at gmail dot com
New email:
PHP Version: OS:

 

 [2014-08-26 15:24 UTC] evgeniy dot arsenyev at gmail dot com
Description:
------------
This bug is pretty similar to Bug #66084 :
simplexml_load_string() incorrectly interprets some XML strings. For specific inputs with empty nodes, node names are converted to integers.

Original bug was fixed, but the same bug appears on a slightly different XML string '<a><c><inner/></c><c><inner>ddd</inner></c></a>'.

Test script:
---------------
print_r(simplexml_load_string('<a><c><inner/></c><c><inner>ddd</inner></c></a>'));

Expected result:
----------------
SimpleXMLElement Object
(
    [c] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [inner] => SimpleXMLElement Object
                        (
                        )

                )

            [1] => SimpleXMLElement Object
                (
                    [inner] => dd
                )

        )

)

Actual result:
--------------
SimpleXMLElement Object
(
    [c] => Array
        (
            [0] => SimpleXMLElement Object
                (
                    [0] => SimpleXMLElement Object
                        (
                        )

                )

            [1] => SimpleXMLElement Object
                (
                    [inner] => ddd
                )

        )

)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-30 18:54 UTC] cmb@php.net
-Status: Open +Status: Duplicate -Assigned To: +Assigned To: cmb
 [2016-11-30 18:54 UTC] cmb@php.net
This appears to be a duplicate of bug #66084, which has been fixed as of PHP 5.5.27 and 5.6.11, see <https://3v4l.org/6E90U>.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Dec 21 11:01:30 2024 UTC