summaryrefslogtreecommitdiff
path: root/include/functions.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/functions.php')
-rw-r--r--include/functions.php20
1 files changed, 16 insertions, 4 deletions
diff --git a/include/functions.php b/include/functions.php
index 7c67b6d09..92c37ae10 100644
--- a/include/functions.php
+++ b/include/functions.php
@@ -1422,9 +1422,9 @@
$intl = get_pref("FRESH_ARTICLE_MAX_AGE", $owner_uid);
if (DB_TYPE == "pgsql") {
- $match_part .= " AND updated > NOW() - INTERVAL '$intl hour' ";
+ $match_part .= " AND date_entered > NOW() - INTERVAL '$intl hour' ";
} else {
- $match_part .= " AND updated > DATE_SUB(NOW(), INTERVAL $intl HOUR) ";
+ $match_part .= " AND date_entered > DATE_SUB(NOW(), INTERVAL $intl HOUR) ";
}
$need_entries = true;
@@ -2892,7 +2892,7 @@
}
}
- $doc->removeChild($doc->firstChild); //remove doctype
+ $doc->removeChild($doc->doctype); //remove doctype
$doc = strip_harmful_tags($doc, $allowed_elements, $disallowed_attributes);
if ($highlight_words) {
@@ -2925,7 +2925,19 @@
}
}
- $res = $doc->saveHTML();
+ $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();
+ }
return $res;
}