]> git.wh0rd.org Git - tt-rss.git/commitdiff
new option: STRIP_UNSAFE_TAGS (utilized)
authorAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 May 2007 07:05:42 +0000 (08:05 +0100)
committerAndrew Dolgov <fox@madoka.spb.ru>
Wed, 16 May 2007 07:05:42 +0000 (08:05 +0100)
functions.php
viewfeed.js

index c8ad1c5ea84989e1d2877552a72904883f4f4e52..5e43a5677432107d937d2ef7644dfc8ca2f6cb7d 100644 (file)
 
                                # sanitize content
                                
-                               $entry_content = sanitize_rss($entry_content);
+//                             $entry_content = sanitize_rss($entry_content);
 
                                if (defined('DAEMON_EXTENDED_DEBUG')) {
                                        _debug("update_rss_feed: done collecting data [TITLE:$entry_title]");
                }
        }
 
-       function sanitize_rss($str) {
+       function sanitize_rss($link, $str) {
                $res = $str;
 
 /*             $res = preg_replace('/<script.*?>/i', 
                        "<p class=\"objectWarn\">(Disabled html object 
                        - flash or other embedded content)</p>", $res);  */
 
-               if (get_pref("STRIP_UNSAFE_TAGS")) {
+               if (get_pref($link, "STRIP_UNSAFE_TAGS")) {
                        $res = strip_tags($res, "<p><a><i><em><b><strong><blockquote><br><img>");
                }
 
 
                        $latest_version = trim(preg_replace("/(Milestone)|(completed)/", "", $latest_item["title"]));
 
-                       $release_url = sanitize_rss($latest_item["link"]);
-                       $content = sanitize_rss($latest_item["description"]);
+                       $release_url = sanitize_rss($link, $latest_item["link"]);
+                       $content = sanitize_rss($link, $latest_item["description"]);
 
                        if (version_compare(VERSION, $latest_version) == -1) {
                                if ($brief_fmt) {
                                $line["content"] = preg_replace("/href=/i", "target=\"_new\" href=", $line["content"]);
                        }
 
-                       $line["content"] = sanitize_rss($line["content"]);
+                       $line["content"] = sanitize_rss($link, $line["content"]);
 
                        print $line["content"] . "</div>";
                        
index 4942a25cf747e44dc24dfa1d58178808784ebc24..c3b28bb80c0817018aa3c48045a2834489f15160 100644 (file)
@@ -46,7 +46,13 @@ function headlines_callback() {
                        var counters = xmlhttp.responseXML.getElementsByTagName("counters")[0];
                        var articles = xmlhttp.responseXML.getElementsByTagName("article");
 
-                       f.innerHTML = headlines.firstChild.nodeValue;
+                       if (headlines) {
+                               f.innerHTML = headlines.firstChild.nodeValue;
+                       } else {
+                               debug("headlines_callback: returned no data");
+                       f.innerHTML = "<div class='whiteBox'>" + __('Could not update headlines (missing XML data)') + "</div>";
+
+                       }
 
                        if (articles) {
                                for (var i = 0; i < articles.length; i++) {
@@ -54,6 +60,8 @@ function headlines_callback() {
                                        debug("found id: " + a_id);
                                        cache_inject(a_id, articles[i].firstChild.nodeValue);
                                }
+                       } else {
+                               debug("no cached articles received");
                        }
 
                        if (counters) {