]> git.wh0rd.org - tt-rss.git/blobdiff - include/rssfuncs.php
pass correct instance of pluginhost to calculate_article_hash
[tt-rss.git] / include / rssfuncs.php
index 776ad54cac2c1d09442b9cb3777417279ea661b8..baf0cab06b5585d48b1a9d8a582af660f942927c 100644 (file)
@@ -4,9 +4,16 @@
        define_default('DAEMON_SLEEP_INTERVAL', 120);
        define_default('_MIN_CACHE_IMAGE_SIZE', 1024);
 
-       function calculate_article_hash($article) {
-               $ph = PluginHost::getInstance();
-               return sha1(implode(":", $ph->get_plugin_names()) . serialize($article));
+       function calculate_article_hash($article, $pluginhost) {
+               $tmp = "";
+
+               foreach ($article as $k => $v) {
+                       if ($k != "feed" && isset($v)) {
+                               $tmp .= sha1("$k:" . (is_array($v) ? implode(",", $v) : $v));
+                       }
+               }
+
+               return sha1(implode(",", $pluginhost->get_plugin_names()) . $tmp);
        }
 
        function update_feedbrowser_cache() {
                                        );
 
                                $entry_plugin_data = "";
-                               $entry_current_hash = calculate_article_hash($article);
+                               $entry_current_hash = calculate_article_hash($article, $pluginhost);
 
                                _debug("article hash: $entry_current_hash [stored=$entry_stored_hash]", $debug_enabled);