]> git.wh0rd.org Git - tt-rss.git/commitdiff
Revert "sanitize: remove doctype properly, add experimental workaround against unnece...
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 6 Oct 2013 11:59:28 +0000 (15:59 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 6 Oct 2013 11:59:28 +0000 (15:59 +0400)
This reverts commit f44d59992edac23206f593e240f0e445c571b661.

include/functions.php

index 92c37ae1039f27191cc0e26d7e0f9515f142125b..040140bbf23c146e3fc1ee813fe13af702fa5ee4 100644 (file)
                        }
                }
 
-               $doc->removeChild($doc->doctype); //remove doctype
+               $doc->removeChild($doc->firstChild); //remove doctype
                $doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes);
 
                if ($highlight_words) {
                        }
                }
 
-               $body = $doc->getElementsByTagName("body")->item(0);
-
-               if ($body) {
-                       $div = $doc->createElement("div");
-
-                       foreach ($body->childNodes as $child) {
-                               $div->appendChild($child);
-                       }
-
-                       $res = $doc->saveXML($div);
-               } else {
-                       $res = $doc->saveHTML();
-               }
+               $res = $doc->saveHTML();
 
                return $res;
        }