php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #46866 xml_parse now ignoring html entities in the xml
Submitted: 2008-12-15 03:57 UTC Modified: 2008-12-18 12:41 UTC
Votes:1
Avg. Score:3.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: bill at billjill dot org Assigned:
Status: Not a bug Package: *XML functions
PHP Version: 5.2.8 OS: Linux
Private report: No CVE-ID: None
 [2008-12-15 03:57 UTC] bill at billjill dot org
Description:
------------
Under 5.2.6 and earlier version, the xml parser would correctly read in html entities (such as <) in the XML. In 5.2.8, these entities are being ignored

Reproduce code:
---------------
You can see the source for a simple test program here: http://outofthebloo.com/test/xmlparsertest.php.txt

Expected result:
----------------
Do a View Source on the result of the xmlparsertest.php program, and you should see this (see the portion toward the bottom near "This should be bold")

Array
(
    [0] => Array
        (
            [name] => OVERLAYS
            [attrs] => Array
                (
                )

            [children] => Array
                (
                    [0] => Array
                        (
                            [name] => OVERLAY
                            [attrs] => Array
                                (
                                )

                            [children] => Array
                                (
                                    [0] => Array
                                        (
                                            [name] => NAME
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => Test
                                        )

                                    [1] => Array
                                        (
                                            [name] => TYPE
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => template
                                        )

                                    [2] => Array
                                        (
                                            [name] => SYNTAX
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => <div id=quote><b>This should be bold</b></div>
                                        )

                                )

                        )

                )

        )

)



Actual result:
--------------
Here's the actual result. NOTE that the "<" and ">" tag characters are missing near the "This should be bold" text:

Array
(
    [0] => Array
        (
            [name] => OVERLAYS
            [attrs] => Array
                (
                )

            [children] => Array
                (
                    [0] => Array
                        (
                            [name] => OVERLAY
                            [attrs] => Array
                                (
                                )

                            [children] => Array
                                (
                                    [0] => Array
                                        (
                                            [name] => NAME
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => Test
                                        )

                                    [1] => Array
                                        (
                                            [name] => TYPE
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => template
                                        )

                                    [2] => Array
                                        (
                                            [name] => SYNTAX
                                            [attrs] => Array
                                                (
                                                )

                                            [tagData] => div id=quotebThis should be bold/b/div
                                        )

                                )

                        )

                )

        )

)



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-12-16 14:20 UTC] rrichards@php.net
Please do not submit the same bug more than once. An existing
bug report already describes this very problem. Even if you feel
that your issue is somewhat different, the resolution is likely
to be the same. 

Thank you for your interest in PHP.

Dupe of bug #45996
 [2008-12-18 12:41 UTC] bill at billjill dot org
My apologies. Many thanks for pointing me toward the correct bug report.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Nov 09 11:01:28 2024 UTC