diff --git a/backend.php b/backend.php index 04539d1b..60399e31 100644 --- a/backend.php +++ b/backend.php @@ -1140,7 +1140,7 @@ if ($subop == "MarkAllRead") { - if (preg_match("/^[0-9][0-9]*$/", $feed) != false) { + if (preg_match("/^[0-9][0-9]*$/", $feed) != false && $feed >= 0) { if ($cat_view) { @@ -1298,7 +1298,7 @@ if ($search && $search_mode == "All feeds") { $query_strategy_part = "ttrss_entries.id > 0"; $vfeed_query_part = "ttrss_feeds.title AS feed_title,"; - } else if (preg_match("/^[0-9][0-9]*$/", $feed) == false) { + } else if (preg_match("/^-?[0-9][0-9]*$/", $feed) == false) { $query_strategy_part = "ttrss_entries.id > 0"; $vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE id = feed_id) as feed_title,"; @@ -1382,9 +1382,11 @@ if ($search && $search_mode == "All feeds") { $feed_title = "Global search results ($search)"; - } else if ($search && sprintf("%d", $feed) == 0) { + } else if ($search && preg_match('/^-?[0-9][0-9]*$/', $feed) == false) { $feed_title = "Feed search results ($search, $feed)"; - } else if ($feed >= 0) { + } else if (preg_match('/^-?[0-9][0-9]*$/', $feed) == false) { + $feed_title = $feed; + } else if (preg_match('/^-?[0-9][0-9]*$/', $feed) != false && $feed >= 0) { if ($cat_view) { @@ -1421,7 +1423,7 @@ print "
"; - if (preg_match("/^[0-9][0-9]*$/", $feed) != false) { + if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) { if ($feed >= 0) { $feed_kind = "Feeds"; diff --git a/functions.js b/functions.js index 14939cdc..ac9b55bf 100644 --- a/functions.js +++ b/functions.js @@ -155,7 +155,11 @@ function cleanSelectedList(element) { if (!document.getElementById("feedCatHolder")) { for (i = 0; i < content.childNodes.length; i++) { var child = content.childNodes[i]; - child.className = child.className.replace("Selected", ""); + try { + child.className = child.className.replace("Selected", ""); + } catch (e) { + // + } } } else { for (i = 0; i < content.childNodes.length; i++) {