php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #7052 CDATA causes auto generate wrong HTML header
Submitted: 2000-10-06 02:14 UTC Modified: 2001-01-12 11:50 UTC
From: kenny at yellowzone dot com Assigned:
Status: Closed Package: DOM XML related
PHP Version: 4.0.2 OS: Linux RedHat 6.2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kenny at yellowzone dot com
New email:
PHP Version: OS:

 

 [2000-10-06 02:14 UTC] kenny at yellowzone dot com
I used xmltree () function to parse a XML code
like the following:

-------------------------------
<dmt_body>
	<![CDATA[
		fool < alio@yello.net > kinda missing.
	]]>
</dmt_body>
--------------------------------

It will create following header and send to the web browser 
by itself.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Since this is not a valid header, IE will not display any
content after that. Does any one know what's wrong and
how to fix it?


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-10-06 02:20 UTC] kenny at yellowzone dot com
I used xmltree () function to parse a XML code
like the following:

-------------------------------
<dmt_body>
	<![CDATA[
		whatever things.
	]]>
</dmt_body>
--------------------------------

It will create following header and send to the web browser 
by itself.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

Since this is not a valid header, IE will not display any
content after that. Does any one know what's wrong and
how to fix it?

I used Apache 1.3.12 and libxml2-2.2.4
 [2000-10-06 05:17 UTC] kenny at yellowzone dot com
I used xmltree () function to parse a XML code
like the following:

model2.xml
-------------------------------
<dmt_body>
	<![CDATA[
		whatever things.
	]]>
</dmt_body>
--------------------------------

Netscape will compliant "The document contained no data".
And IE will say "The Page can not be displayed..."

My php code looks like the following:
-------------------------------------------
<html><pre>
<?
	$data = implode("",file("model2.xml"));
        // Error is generated here, by xmltree
        // even there is no print_r() statement.
	$osah = xmltree ($data);
?>
</pre></html>

-------------------------------------------

I used Apache 1.3.12 and libxml2-2.2.4

 [2001-01-12 11:50 UTC] sniper@php.net
Fixed in CVS.

--Jani
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Sat Nov 28 00:01:24 2020 UTC