php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #44116 DOMDocument->loadHTMLFile() & ->saveHtml(), losing misc characters after save
Submitted: 2008-02-14 03:23 UTC Modified: 2008-04-03 01:00 UTC
From: chris dot shepherd at gmail dot com Assigned:
Status: No Feedback Package: DOM XML related
PHP Version: 5.2CVS-2008-02-14 (snap) OS: Fedora Core 6
Private report: No CVE-ID: None
 [2008-02-14 03:23 UTC] 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. 


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2008-03-26 19:57 UTC] rrichards@php.net
Cannot reproduce. Have you tried an updated version of libxml2?
 [2008-04-03 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Dec 04 12:01:30 2024 UTC