#44116 [Opn->Fbk]: DOMDocument->loadHTMLFile() & ->saveHtml(), losing misc characters after save

From: Date: Wed, 26 Mar 2008 19:57:31 +0000
Subject: #44116 [Opn->Fbk]: DOMDocument->loadHTMLFile() & ->saveHtml(), losing misc characters after save
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-123679@lists.php.net to get a copy of this message
 ID:               44116
 Updated by:       rrichards@php.net
 Reported By:      chris dot shepherd at gmail dot com
-Status:           Open
+Status:           Feedback
 Bug Type:         DOM XML related
 Operating System: Fedora Core 6
 PHP Version:      5.2CVS-2008-02-14 (snap)
 New Comment:

Cannot reproduce. Have you tried an updated version of libxml2?


Previous Comments:
------------------------------------------------------------------------

[2008-02-14 03:23:22] chris dot shepherd at gmail dot com

Description:
------------
I built a script which I pull the html down from a url and then do some
editing and output the source with ->saveHTML(); 

I noticed every now and again the code outputted was missing characters
in misc spots. For example one of my <div> became a <di>. I noticed this
through a diff.

I wanted to eliminate it being on my end of the code so I simply pulled
out all the code and left just $doc->loadHTMLFile($url); and then simply
output with $doc->saveHTML(); 

If do this and hit refresh, it would during random refreshes lose the
character (every 10/15 refreshes). It was always characters in the same
place in my code, but random when they would disappear.

Reproduce code:
---------------
$conn = $doc->loadHTMLFile('http://www.chrishan.org');
	
if($conn){
    echo "<textarea rows=40>";
    echo $doc->saveHTML();
    echo "</textarea>";
}

Expected result:
----------------
I expect it to output my sourcecode from my website. But every 10 to 15
refreshes it loses a couple misc characters from my source. 



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


-- 
Edit this bug report at http://bugs.php.net/?id=44116&edit=1



Thread (2 messages)

« previous php.bugs (#123679) next »