|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #30275 Erroneous 'Undeclared entity' error
Submitted: 2004-09-29 14:41 UTC Modified: 2004-11-12 12:42 UTC
Avg. Score:4.7 ± 0.9
Reproduced:23 of 23 (100.0%)
Same Version:21 (91.3%)
Same OS:4 (17.4%)
From: michiel at trendserver dot nl Assigned:
Status: Not a bug Package: XML related
PHP Version: 5.0.2 OS: Debian
Private report: No CVE-ID: None
 [2004-09-29 14:41 UTC] michiel at trendserver dot nl
The XML extension in PHP5(.02) seems to fail on the use entities that are declared in the same XML file.

Reproduce code:
$xml = <<<HERE
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE test [
<!ENTITY uuml "&#252;">

$parser = xml_parser_create();
if (!xml_parse($parser, $xml))
    echo xml_error_string(xml_get_error_code($parser)) . "\n";

Expected result:
No errors.

Actual result:
Undeclared entity error.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-09-29 14:54 UTC] michiel at trendserver dot nl
Also occurs using
 [2004-10-12 20:09 UTC] apocalypsys dot NOSP at M dot ukr dot net
 OS: Windows XP SP1
 PHP: 4.3.7, 4.3.2
 Error: External entity reference works perfect, but internal reference - don't. I simply get a space instead of text of my entity.

 OS: Windows XP SP1
 PHP: 5.0.2
 Error: "Undeclared entity error".
 [2004-11-05 14:42 UTC] joern_h at gmx dot net
I modified the example to call the xml handlers, PHP 5.0.2 on Windows 2000 calls the external_entity_ref_handler for the declaration of the entity, this does not happen with 4.3.8
 [2004-11-12 12:42 UTC]
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.

See Bug #30219
PHP Copyright © 2001-2022 The PHP Group
All rights reserved.
Last updated: Wed Dec 07 21:04:14 2022 UTC