PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

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;
}