From 7c6f7bb0aa50f42fd697fbe82dc9b8b5931a3a52 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 3 Dec 2017 23:08:04 +0300 Subject: fix some minor issues found by code analyzer --- classes/feeds.php | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) (limited to 'classes/feeds.php') diff --git a/classes/feeds.php b/classes/feeds.php index b52b580f4..983a85512 100755 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -64,7 +64,7 @@ class Feeds extends Handler_Protected { $target = "target=\"_blank\""; $reply .= "". - truncate_string($feed_title, 30).""; + truncate_string(strip_tags($feed_title), 30).""; if ($error) { $error = htmlspecialchars($error); @@ -72,7 +72,7 @@ class Feeds extends Handler_Protected { } } else { - $reply .= $feed_title; + $reply .= strip_tags($feed_title); } $reply .= ""; @@ -440,11 +440,8 @@ class Feeds extends Handler_Protected { if ($vfeed_group_enabled) { if ($feed_id != $vgroup_last_feed && $line["feed_title"]) { - $cur_feed_title = $line["feed_title"]; $vgroup_last_feed = $feed_id; - $cur_feed_title = htmlspecialchars($cur_feed_title); - $vf_catchup_link = "".__('mark feed as read').""; $reply['content'] .= "
". @@ -572,7 +569,7 @@ class Feeds extends Handler_Protected { $tmp_content .= "
"; - if ($highlight_words && count($highlight_words > 0)) { + if ($highlight_words && count($highlight_words) > 0) { foreach ($highlight_words as $word) { $line["title"] = preg_replace("/(\Q$word\E)/i", "$1", $line["title"]); @@ -1540,13 +1537,7 @@ class Feeds extends Handler_Protected { $url = key($feedUrls); } - if ($cat_id == "0" || !$cat_id) { - $cat_qpart = "NULL"; - } else { - $cat_qpart = "'$cat_id'"; - } - - if (!(int)$cat_id) $cat_id = null; + if (!$cat_id) $cat_id = null; $sth = $pdo->prepare("SELECT id FROM ttrss_feeds WHERE feed_url = ? AND owner_uid = ?"); -- cgit v1.2.3-54-g00ecf