use saveHTML() in sanitize instead of saveXML() (refs #522)

This commit is contained in:
Andrew Dolgov 2013-03-17 17:02:59 +04:00
parent cf2f643edb
commit 18f24d8e4c
1 changed files with 3 additions and 2 deletions

View File

@ -2595,9 +2595,10 @@
} }
} }
$node = $doc->getElementsByTagName('body')->item(0); //$node = $doc->getElementsByTagName('body')->item(0);
$res = $doc->saveXML($node, LIBXML_NOEMPTYTAG); $doc->removeChild($doc->firstChild); //remove doctype
$res = $doc->saveHTML();
$config = array('safe' => 1, 'deny_attribute' => 'style, width, height, class, id', 'comment' => 1, 'cdata' => 1, 'balance' => 0); $config = array('safe' => 1, 'deny_attribute' => 'style, width, height, class, id', 'comment' => 1, 'cdata' => 1, 'balance' => 0);
$spec = 'img=width,height'; $spec = 'img=width,height';