From: Andrew Dolgov Date: Mon, 18 Aug 2014 17:55:48 +0000 (+0400) Subject: tweak article hash function X-Git-Tag: 1.14~30 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=af244f927e3464c595fd53021f315dd0c4c31ec0 tweak article hash function --- diff --git a/include/rssfuncs.php b/include/rssfuncs.php index 776ad54c..754b4f4c 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -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() {