#35027 [Opn]: Specific proper XML code breaks xml parser

From: Date: Sun, 30 Oct 2005 18:47:01 +0000
Subject: #35027 [Opn]: Specific proper XML code breaks xml parser
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-87231@lists.php.net to get a copy of this message
ID: 35027 User updated by: php at puntloos dot nl Reported By: php at puntloos dot nl Status: Open Bug Type: *XML functions Operating System: Linux Debian 2.6.13 PHP Version: 5.0.5 New Comment: Normally I would be the first to say that my XML is lacking, at best, so maybe it's just bad XML that can be found by snipping off parts of the code until the error goes away. But I've tried that. If you remove -any- of the ITEMs of my 'break.rss' the situation fixes itself, so *I* cant narrow it down beyond what's in break.rss. Previous Comments: ------------------------------------------------------------------------ [2005-10-30 19:08:20] php at puntloos dot nl Description: ------------ I've got a specific, properly formatted (as far as I can tell) RSS file that breaks the XML parser. Reproduce code: --------------- <?php $url="http://130.89.22.201/break.rss"; $data=@fread(fopen("$url","r"),140000) or die("Cant open $url!"); $myar=getXmlData($data); function getXmlData($xml_doc) { $parser = xml_parser_create(); xml_parse_into_struct($parser,$xml_doc,$vals,$index) or die(xml_error_string(xml_get_error_code($parser))); xml_parser_free($parser); } ?> Expected result: ---------------- I expect it not to produce "Invalid document end" with the rss file (http://130.89.22.201/break.rss) Actual result: -------------- It procudes "Invalid document end" :P Somehow it seems to do with the total size of the RSS file but I've parsed way bigger files. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=35027&edit=1

« previous php.bugs (#87231) next »