maybe we shouldn't escape entry_author twice

This commit is contained in:
Andrew Dolgov 2016-11-25 14:04:41 +03:00
parent f04b12d8e7
commit 12ff230bc2
1 changed files with 5 additions and 28 deletions

View File

@ -669,16 +669,12 @@
print "\n"; print "\n";
} }
$entry_comments = $item->get_comments_url(); $entry_comments = db_escape_string(mb_substr($item->get_comments_url(), 0, 245));
$entry_author = $item->get_author();
$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(); $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));
_debug("author $entry_author", $debug_enabled); _debug("author $entry_author", $debug_enabled);
_debug("num_comments: $num_comments", $debug_enabled); _debug("num_comments: $num_comments", $debug_enabled);
_debug("looking for tags...", $debug_enabled); _debug("looking for tags...", $debug_enabled);
@ -849,7 +845,7 @@
$entry_tags = $article["tags"]; $entry_tags = $article["tags"];
$entry_guid = db_escape_string($entry_guid); $entry_guid = db_escape_string($entry_guid);
$entry_title = db_escape_string($article["title"]); $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_link = db_escape_string($article["link"]);
$entry_content = $article["content"]; // escaped below $entry_content = $article["content"]; // escaped below
$entry_force_catchup = $article["force_catchup"]; $entry_force_catchup = $article["force_catchup"];
@ -985,25 +981,6 @@
$published = 'false'; $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_marked = ($marked == 'true') ? 'NOW()' : 'NULL';
$last_published = ($published == 'true') ? 'NOW()' : 'NULL'; $last_published = ($published == 'true') ? 'NOW()' : 'NULL';