summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2016-11-25 14:04:41 +0300
committerAndrew Dolgov <[email protected]>2016-11-25 14:04:41 +0300
commit12ff230bc28c9b06b0ef1917677fd54323a5624d (patch)
treee16c019fc0b9501da38fd86d4225de3dc68bd724 /include
parentf04b12d8e7f5339ffc57f1d0492158571c3921f0 (diff)
maybe we shouldn't escape entry_author twice
Diffstat (limited to 'include')
-rw-r--r--include/rssfuncs.php31
1 files changed, 4 insertions, 27 deletions
diff --git a/include/rssfuncs.php b/include/rssfuncs.php
index ccc6d5154..25a24d194 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';