PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_Parser » Bug #588

XML_Parser incorrectly returns an error when parsing long strings

Details

Submitted2004-01-16 00:46 UTC
Fromdave at gottathink dot com
Assignedschst
StatusBogus
PackageXML_Parser
PHP Version4.3.4
OSWindows XP
Roadmaps(Not assigned)

Comments

[2004-01-16 00:46 UTC] dave at gottathink dot com

Description:
------------
xml_parse() returns a null on my system if what you give it to parse isn't the full document. Since null == false, XML_Parser thinks that an error has occurred and raises an error of its own. Adding a null check to XML_Parser::parseString() fixes the problem.

function parseString($data, $eof = false)
{
$code = xml_parse($this->parser, $data, $eof);
if (!is_null($code) && !$code) {
$err = $this->raiseError($this->parser);
xml_parser_free($this->parser);
return $err;
}

return true;
}