From: Andrew Dolgov Date: Fri, 25 Nov 2016 11:04:41 +0000 (+0300) Subject: maybe we shouldn't escape entry_author twice X-Git-Tag: 17.1~32 X-Git-Url: https://git.wh0rd.org/?p=tt-rss.git;a=commitdiff_plain;h=12ff230bc28c9b06b0ef1917677fd54323a5624d maybe we shouldn't escape entry_author twice --- diff --git a/include/rssfuncs.php b/include/rssfuncs.php index ccc6d515..25a24d19 100644 --- a/include/rssfuncs.php +++ b/include/rssfuncs.php @@ -669,16 +669,12 @@ print "\n"; } - $entry_comments = $item->get_comments_url(); - $entry_author = $item->get_author(); + $entry_comments = db_escape_string(mb_substr($item->get_comments_url(), 0, 245)); + $num_comments = (int) $item->get_comments_count(); + $entry_author = $item->get_author(); // escaped later $entry_guid = db_escape_string(mb_substr($entry_guid, 0, 245)); - $entry_comments = db_escape_string(mb_substr(trim($entry_comments), 0, 245)); - $entry_author = db_escape_string(mb_substr(trim($entry_author), 0, 245)); - - $num_comments = (int) $item->get_comments_count(); - _debug("author $entry_author", $debug_enabled); _debug("num_comments: $num_comments", $debug_enabled); _debug("looking for tags...", $debug_enabled); @@ -849,7 +845,7 @@ $entry_tags = $article["tags"]; $entry_guid = db_escape_string($entry_guid); $entry_title = db_escape_string($article["title"]); - $entry_author = db_escape_string($article["author"]); + $entry_author = db_escape_string(mb_substr($article["author"], 0, 245)); $entry_link = db_escape_string($article["link"]); $entry_content = $article["content"]; // escaped below $entry_force_catchup = $article["force_catchup"]; @@ -985,25 +981,6 @@ $published = 'false'; } - // N-grams - - /* if (DB_TYPE == "pgsql" and defined('_NGRAM_TITLE_DUPLICATE_THRESHOLD')) { - - $result = db_query("SELECT COUNT(*) AS similar FROM - ttrss_entries,ttrss_user_entries - WHERE ref_id = id AND updated >= NOW() - INTERVAL '7 day' - AND similarity(title, '$entry_title') >= "._NGRAM_TITLE_DUPLICATE_THRESHOLD." - AND owner_uid = $owner_uid"); - - $ngram_similar = db_fetch_result($result, 0, "similar"); - - _debug("N-gram similar results: $ngram_similar", $debug_enabled); - - if ($ngram_similar > 0) { - $unread = 'false'; - } - } */ - $last_marked = ($marked == 'true') ? 'NOW()' : 'NULL'; $last_published = ($published == 'true') ? 'NOW()' : 'NULL';