]> git.wh0rd.org Git - tt-rss.git/commitdiff
update: feed escaping issue
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 16 Dec 2012 09:38:50 +0000 (13:38 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Sun, 16 Dec 2012 09:38:50 +0000 (13:38 +0400)
include/rssfuncs.php

index 1b39efec1010f79a5dabefc9f0b0c743fc8436cf..eaa975a5af04f4b4f09cc8aca6cf732c3e5cf06f 100644 (file)
                                        print "\n";
                                }
 
-                               $entry_content_unescaped = $entry_content;
                                $entry_cached_content = "";
 
                                if ($use_simplepie) {
                                $result = db_query($link, "SELECT id FROM       ttrss_entries
                                        WHERE guid = '$entry_guid'");
 
-                               $entry_content = db_escape_string($entry_content, false);
-
-                               $entry_title = db_escape_string($entry_title);
-                               $entry_link = db_escape_string($entry_link);
                                $entry_comments = mb_substr(db_escape_string($entry_comments), 0, 250);
                                $entry_author = mb_substr($entry_author, 0, 250);
 
                                $entry_tags = null;
 
                                preg_match_all("/<a.*?rel=['\"]tag['\"].*?\>([^<]+)<\/a>/i",
-                                       $entry_content_unescaped, $entry_tags);
+                                       $entry_content, $entry_tags);
 
                                $entry_tags = $entry_tags[1];
 
                                        $entry_author = $article["author"];
                                }
 
+                               $entry_content = db_escape_string($entry_content, false);
+                               $entry_title = db_escape_string($entry_title);
+                               $entry_author = db_escape_string($entry_author);
+                               $entry_link = db_escape_string($entry_link);
+
                                $content_hash = "SHA1:" . sha1(strip_tags($entry_content));
 
                                db_query($link, "BEGIN");