From 3a142cbf58b927a7e0d7ac07922e19ee73440eef Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 17 May 2020 17:42:37 +0300 Subject: calculate_article_hash: ignore some useless or read-only fields (i.e. GUID) when calculating hash --- classes/rssutils.php | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'classes') diff --git a/classes/rssutils.php b/classes/rssutils.php index dc00510b5..72d85403e 100755 --- a/classes/rssutils.php +++ b/classes/rssutils.php @@ -3,7 +3,12 @@ class RSSUtils { static function calculate_article_hash($article, $pluginhost) { $tmp = ""; + $ignored_fields = [ "feed", "guid", "guid_hashed", "owner_uid", "force_catchup" ]; + foreach ($article as $k => $v) { + if (in_array($k, $ignored_fields)) + continue; + if ($k != "feed" && isset($v)) { $x = strip_tags(is_array($v) ? implode(",", $v) : $v); @@ -11,6 +16,8 @@ class RSSUtils { } } + die; + return sha1(implode(",", $pluginhost->get_plugin_names()) . $tmp); } -- cgit v1.2.3