]> git.wh0rd.org - tt-rss.git/commitdiff
tweak article hash function
authorAndrew Dolgov <noreply@fakecake.org>
Mon, 18 Aug 2014 17:55:48 +0000 (21:55 +0400)
committerAndrew Dolgov <noreply@fakecake.org>
Mon, 18 Aug 2014 17:55:48 +0000 (21:55 +0400)
include/rssfuncs.php

index 776ad54cac2c1d09442b9cb3777417279ea661b8..754b4f4cc97fad7808241da9cd428c006b525eef 100644 (file)
@@ -5,8 +5,15 @@
        define_default('_MIN_CACHE_IMAGE_SIZE', 1024);
 
        function calculate_article_hash($article) {
-               $ph = PluginHost::getInstance();
-               return sha1(implode(":", $ph->get_plugin_names()) . serialize($article));
+               $tmp = "";
+
+               foreach ($article as $k => $v) {
+                       if ($k != "feed" && isset($v)) {
+                               $tmp .= sha1("$k:" . (is_array($v) ? implode(",", $v) : $v));
+                       }
+               }
+
+               return sha1(implode(",", PluginHost::getInstance()->get_plugin_names())) . ":" . sha1($tmp);
        }
 
        function update_feedbrowser_cache() {