]> git.wh0rd.org - tt-rss.git/commitdiff
update_rss_feed: fix article update detection
authorAndrew Dolgov <fox@bah.spb.su>
Sat, 19 May 2007 05:02:51 +0000 (06:02 +0100)
committerAndrew Dolgov <fox@bah.spb.su>
Sat, 19 May 2007 05:02:51 +0000 (06:02 +0100)
functions.php

index 568c13995bdfe340f181658767e2900a59e62bba..d3245ce531bf9bf51ba6a5c1544b2df279a14acb 100644 (file)
 //                             print "<br>";
 
                                $entry_content_unescaped = $entry_content;
-                               $content_hash = "SHA1:" . sha1(strip_tags($entry_content));
 
                                $entry_comments = strip_tags($item["comments"]);
 
                                        WHERE guid = '$entry_guid'");
 
                                $entry_content = db_escape_string($entry_content);
+
+                               $content_hash = "SHA1:" . sha1(strip_tags($entry_content));
+
                                $entry_title = db_escape_string($entry_title);
                                $entry_link = db_escape_string($entry_link);
                                $entry_comments = db_escape_string($entry_comments);
 
                                        if (get_pref($link, "UPDATE_POST_ON_CHECKSUM_CHANGE", $owner_uid, false) &&
                                                ($content_hash != $orig_content_hash)) {
+//                                             print "<!-- [$entry_title] $content_hash vs $orig_content_hash -->";
                                                $post_needs_update = true;
                                        }
 
-                                       if ($orig_title != $entry_title) {
+                                       if (db_escape_string($orig_title) != $entry_title) {
                                                $post_needs_update = true;
                                        }
 
 
                                                db_query($link, "UPDATE ttrss_entries 
                                                        SET title = '$entry_title', content = '$entry_content',
+                                                               content_hash = '$content_hash',
                                                                num_comments = '$num_comments'
                                                        WHERE id = '$ref_id'");