calculate_article_hash: ignore some useless or read-only fields (i.e. GUID) when calculating hash

This commit is contained in:
Andrew Dolgov 2020-05-17 17:42:37 +03:00
parent 25c8467753
commit 3a142cbf58
1 changed files with 7 additions and 0 deletions

View File

@ -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);
}