Defect #101
Work-around bug in libxml 2.7.0/2.7.1 of parsing of predefined entities
| Status: | Verified | Start: | 2008-10-07 | |
| Priority: | High | Due date: | ||
| Assigned to: | Geoffrey Sneddon | % Done: | 0% |
|
| Category: | Parser | |||
| Target version: | 1.1.2 | |||
| Affected Version: | 1.1.1 |
PHP Version: | 5.2.6 |
|
| mbstring enabled: | No |
iconv enabled: | No |
|
| cURL enabled: | No |
zlib enabled: | No |
|
Description
Due to a bug in versions 2.7.0/2.7.1 of libxml2, the < > and & are eaten by the XML parser, giving unexpected results in the simpepie output. (See this bug: http://bugs.php.net/bug.php?id=45996)
Replacing the mentioned entities with their numeric equivalents seems solve the problem.
This is not really a bug in simplepie but it can be worked around for now. As Geoffrey suggested on the mailing list, perhaps this hack can be done conditionally for 2.7.0/2.7.1 versions of libxml2, as it seems to be resolved in 2.7.2.
patch to fix/workaround:
--- tt-rss-20080919.org/simplepie/simplepie.inc 2008-09-19 02:00:03.000000000 +0200
+++ tt-rss-20080919.alex/simplepie/simplepie.inc 2008-09-21 01:29:13.000000000 +0200
@@ -12761,6 +12761,10 @@
xml_set_character_data_handler($xml, 'cdata');
xml_set_element_handler($xml, 'tag_open', 'tag_close');
+ $data=str_replace("<","<",$data);
+ $data=str_replace(">",">",$data);
+ $data=str_replace("&","&",$data);
+
// Parse!
if (!xml_parse($xml, $data, true))
{
Alex.
Related issues
| related to Defect #109 | Extend libxml workaround to other versions | Fixed | 2008-11-23 | ||
| related to Defect #120 | libxml workaround has broken test cases | Fixed | 2009-01-31 |
Associated revisions
History
Updated by Geoffrey Sneddon 521 days ago
- Category set to Parser
- Status changed from Unconfirmed to New
- Priority changed from Medium to High
- Target version set to 1.1.2
I'm guessing this also affects '.
Updated by Geoffrey Sneddon 511 days ago
- File 101.patch added
- Assigned to set to Geoffrey Sneddon
Proposed patch attached. Can anyone test this?
Updated by Geoffrey Sneddon 499 days ago
- Status changed from New to Fixed
Applied in changeset r1008.
Updated by Geoffrey Sneddon 488 days ago
- Status changed from Fixed to Verified
Updated by Geoffrey Sneddon 481 days ago
- Subject changed from parsing problems with < > and & on libxml2 2.7+ to Work-around bug in libxml 2.7.0/2.7.1 of parsing of predefined entities