diff options
-rw-r--r-- | classes/handler/public.php | 2 | ||||
-rw-r--r-- | include/functions.php | 20 | ||||
-rw-r--r-- | plugins/cache_starred_images/init.php | 2 | ||||
-rw-r--r-- | templates/generated_feed.txt | 4 |
4 files changed, 22 insertions, 6 deletions
diff --git a/classes/handler/public.php b/classes/handler/public.php index c5a2a03cb..a656ed63b 100644 --- a/classes/handler/public.php +++ b/classes/handler/public.php @@ -123,7 +123,7 @@ class Handler_Public extends Handler { $tpl->setVariable('ARTICLE_AUTHOR', htmlspecialchars($line['author']), true); $tpl->setVariable('ARTICLE_SOURCE_LINK', htmlspecialchars($line['site_url']), true); - $tpl->setVariable('ARTICLE_SOURCE_TITLE', htmlspecialchars($line['feed_title']), true); + $tpl->setVariable('ARTICLE_SOURCE_TITLE', htmlspecialchars($line['feed_title'] ? $line['feed_title'] : $feed_title), true); $tags = get_article_tags($line["id"], $owner_uid); 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; } diff --git a/plugins/cache_starred_images/init.php b/plugins/cache_starred_images/init.php index f721b3892..6e62bde76 100644 --- a/plugins/cache_starred_images/init.php +++ b/plugins/cache_starred_images/init.php @@ -39,6 +39,8 @@ class Cache_Starred_Images extends Plugin { } function image() { + ob_end_clean(); + $hash = basename($_REQUEST["hash"]); if ($hash) { diff --git a/templates/generated_feed.txt b/templates/generated_feed.txt index c1f921c45..5e35f9be1 100644 --- a/templates/generated_feed.txt +++ b/templates/generated_feed.txt @@ -15,13 +15,15 @@ <entry> <id>${ARTICLE_ID}</id> <link href="${ARTICLE_LINK}" rel="alternate" type="text/html"/> - <title>${ARTICLE_TITLE}</title> + <title type="html">${ARTICLE_TITLE}</title> <summary type="html"><![CDATA[${ARTICLE_EXCERPT}]]></summary> <content type="html"><![CDATA[${ARTICLE_CONTENT}]]></content> <updated>${ARTICLE_UPDATED_ATOM}</updated> <author><name>${ARTICLE_AUTHOR}</name></author> <source> + <id>${ARTICLE_SOURCE_LINK}</id> <link rel="self" href="${ARTICLE_SOURCE_LINK}"/> + <updated>${ARTICLE_UPDATED_ATOM}</updated> <title>${ARTICLE_SOURCE_TITLE}</title></source> <!-- $BeginBlock category --> <category term="${ARTICLE_CATEGORY}"/> |