summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2013-10-06 15:59:28 +0400
committerAndrew Dolgov <[email protected]>2013-10-06 15:59:28 +0400
commite198cca75bc5f6bc573174739780e18b4c6a7daa (patch)
tree6fecc18ddfcf9732a912a62eeaed95aacb03bae6 /include
parent29a57cdc4d81374b212c346099f9f2272037d815 (diff)
Revert "sanitize: remove doctype properly, add experimental workaround against unnecessary html elements in sanitized data"
This reverts commit f44d59992edac23206f593e240f0e445c571b661.
Diffstat (limited to 'include')
-rw-r--r--include/functions.php16
1 files changed, 2 insertions, 14 deletions
diff --git a/include/functions.php b/include/functions.php
index 92c37ae10..040140bbf 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -2892,7 +2892,7 @@
}
}
- $doc->removeChild($doc->doctype); //remove doctype
+ $doc->removeChild($doc->firstChild); //remove doctype
$doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes);
if ($highlight_words) {
@@ -2925,19 +2925,7 @@
}
}
- $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;
}