From: chris dot shepherd at gmail dot com
Operating system: Fedora Core 6
PHP version: 5.2CVS-2008-02-14 (snap)
PHP Bug Type: DOM XML related
Bug description: DOMDocument->loadHTMLFile() & ->saveHtml(), losing misc
characters after save
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 bug report at http://bugs.php.net/?id=44116&edit=1
--
Try a CVS snapshot (PHP 4.4):
http://bugs.php.net/fix.php?id=44116&r=trysnapshot44
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=44116&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=44116&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=44116&r=trysnapshot60
Fixed in CVS: http://bugs.php.net/fix.php?id=44116&r=fixedcvs
Fixed in release:
http://bugs.php.net/fix.php?id=44116&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=44116&r=needtrace
Need Reproduce Script: http://bugs.php.net/fix.php?id=44116&r=needscript
Try newer version: http://bugs.php.net/fix.php?id=44116&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=44116&r=support
Expected behavior: http://bugs.php.net/fix.php?id=44116&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=44116&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=44116&r=submittedtwice
register_globals: http://bugs.php.net/fix.php?id=44116&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=44116&r=php3
Daylight Savings: http://bugs.php.net/fix.php?id=44116&r=dst
IIS Stability: http://bugs.php.net/fix.php?id=44116&r=isapi
Install GNU Sed: http://bugs.php.net/fix.php?id=44116&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=44116&r=float
No Zend Extensions: http://bugs.php.net/fix.php?id=44116&r=nozend
MySQL Configuration Error: http://bugs.php.net/fix.php?id=44116&r=mysqlcfg