]> git.wh0rd.org - tt-rss.git/commitdiff
calculate_article_hash: strip tags before hashing fields
authorAndrew Dolgov <noreply@fakecake.org>
Sat, 5 Dec 2015 00:10:57 +0000 (03:10 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sat, 5 Dec 2015 00:10:57 +0000 (03:10 +0300)
include/rssfuncs.php

index af4762c7f61151d51777a8fc60408cd294395ec7..115d9c9c2ce1cd4379e9b95461feaf5120f40e6e 100755 (executable)
@@ -9,7 +9,11 @@
 
                foreach ($article as $k => $v) {
                        if ($k != "feed" && isset($v)) {
-                               $tmp .= sha1("$k:" . (is_array($v) ? implode(",", $v) : $v));
+                               $x = strip_tags(is_array($v) ? implode(",", $v) : $v);
+
+                               //_debug("$k:" . sha1($x) . ":" . htmlspecialchars($x), true);
+
+                               $tmp .= sha1("$k:" . sha1($x));
                        }
                }
 
                                                        SET score = '$score' WHERE ref_id = '$ref_id'");
 
                                        if ($mark_unread_on_update) {
+                                               _debug("article updated, marking unread as requested.", $debug_enabled);
+
                                                db_query("UPDATE ttrss_user_entries
                                                        SET last_read = null, unread = true WHERE ref_id = '$ref_id'");
                                        }