php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39382 "Undeclared entity error" with latin1 entities
Submitted: 2006-11-04 20:31 UTC Modified: 2006-11-04 21:24 UTC
From: phpbugs at thequod dot de Assigned:
Status: Not a bug Package: XML related
PHP Version: 5CVS-2006-11-04 (CVS) OS: Ubuntu Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbugs at thequod dot de
New email:
PHP Version: OS:

 

 [2006-11-04 20:31 UTC] phpbugs at thequod dot de
Description:
------------
Using a regular entity like "®" throws a "Undeclared 
entity warning" error with xml_parse().

If this is bogus, please give a hint about what I'm doing 
wrong.
Is this maybe a libxml problem?

btw: it also fails with other DOCTYPEs or with a full 
html-head-body construct.

Reproduce code:
---------------
<?php
$xml = '<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<body>&reg;</body>';

$parser = xml_parser_create();
if (!xml_parse($parser, $xml))
{
    echo xml_error_string(xml_get_error_code($parser)) . "\n";
}
xml_parser_free($parser);
?>


Expected result:
----------------
Nothing.

(as with PHP4)

Actual result:
--------------
Undeclared entity warning

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-11-04 21:24 UTC] phpbugs at thequod dot de
I'm closing it myself.
http://bugs.php.net/bug.php?id=15092 explains why it does 
not work.

Would be interested in why it works with PHP4 though..
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC