php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #53677 xml_parse_into_struct deletes unescaped character data
Submitted: 2011-01-06 21:40 UTC Modified: 2011-01-07 14:06 UTC
From: lwc at mailmetrash dot com Assigned:
Status: Not a bug Package: XML related
PHP Version: 5.2.14 OS: Redhat Linux
Private report: No CVE-ID: None
 [2011-01-06 21:40 UTC] lwc at mailmetrash dot com
Description:
------------
Assuming #26528 is also valid for the actual character data (as claimed in http://forum.alicebot.org/viewtopic.php?t=69), then the parser should decode <this>&lt;that&gt;</this> into:
[name] => this
[value] => <that>
The problem is in some cases it stays as:
[name] => this
[value] => &lt;that&gt;

In my 2 unrelated servers, the decoding works in v5.2.6 but fails in v5.2.14.

Please check in newer versions, if you can!


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-01-06 21:48 UTC] lwc at mailmetrash dot com
As for the "(as claimed in)" comment, you can delete it. They actually claim you should use straight up HTML without escaping it. Problem is the parser then treats the HTML tags like XML ones. If you have a solution for that one, please post it there.
 [2011-01-06 22:05 UTC] lwc at mailmetrash dot com
-Summary: xml_parse_into_struct does not unescape character data +Summary: xml_parse_into_struct deletes unescaped character data
 [2011-01-06 22:05 UTC] lwc at mailmetrash dot com
Sorry, here's a fixed description. <this>&lt;that&gt;tag&lt;that/&gt;</this> should turn into:
[name] => this
[value] => <that>tag</that>
But in some cases it turns into:
[name] => this
[value] => tag/

That is, it's not even kept. It's just deleted!
 [2011-01-07 01:25 UTC] lwc at mailmetrash dot com
-Status: Open +Status: Closed
 [2011-01-07 01:25 UTC] lwc at mailmetrash dot com
Sorry, you can delete this bug. The fixed description made me realize it's a duplicate of #45996.
 [2011-01-07 14:06 UTC] rrichards@php.net
-Status: Closed +Status: Bogus
 [2011-01-07 14:06 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
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 10:01:28 2024 UTC