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
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: chris dot shepherd at gmail dot com
New email:
PHP Version: OS:

 

 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2022 The PHP Group
All rights reserved.
Last updated: Sun Jan 16 19:03:36 2022 UTC