mirror of
https://git.tt-rss.org/git/tt-rss.git
synced 2025-12-13 11:55:56 +00:00
replace several preg_match() feed id tests with is_numeric()
This commit is contained in:
@@ -154,7 +154,7 @@ class Feeds extends Handler_Protected {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {
|
if (is_numeric($feed) && $feed > 0) {
|
||||||
|
|
||||||
$result = db_query($this->link, "SELECT rtl_content FROM ttrss_feeds
|
$result = db_query($this->link, "SELECT rtl_content FROM ttrss_feeds
|
||||||
WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]);
|
WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]);
|
||||||
@@ -806,7 +806,7 @@ class Feeds extends Handler_Protected {
|
|||||||
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);
|
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);
|
||||||
set_pref($this->link, "_DEFAULT_INCLUDE_CHILDREN", $include_children);
|
set_pref($this->link, "_DEFAULT_INCLUDE_CHILDREN", $include_children);
|
||||||
|
|
||||||
if (!$cat_view && preg_match("/^[0-9][0-9]*$/", $feed)) {
|
if (!$cat_view && is_numeric($feed) && $feed > 0) {
|
||||||
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()
|
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()
|
||||||
WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);
|
WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2336,7 +2336,7 @@
|
|||||||
$query_strategy_part = "ttrss_entries.id > 0";
|
$query_strategy_part = "ttrss_entries.id > 0";
|
||||||
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
|
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
|
||||||
/* tags */
|
/* tags */
|
||||||
} else if (preg_match("/^-?[0-9][0-9]*$/", $feed) == false) {
|
} else if (!is_numeric($feed)) {
|
||||||
$query_strategy_part = "ttrss_entries.id > 0";
|
$query_strategy_part = "ttrss_entries.id > 0";
|
||||||
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
|
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
|
||||||
id = feed_id) as feed_title,";
|
id = feed_id) as feed_title,";
|
||||||
@@ -2496,7 +2496,7 @@
|
|||||||
|
|
||||||
$content_query_part = "content as content_preview,";
|
$content_query_part = "content as content_preview,";
|
||||||
|
|
||||||
if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {
|
if (is_numeric($feed)) {
|
||||||
|
|
||||||
if ($feed >= 0) {
|
if ($feed >= 0) {
|
||||||
$feed_kind = "Feeds";
|
$feed_kind = "Feeds";
|
||||||
|
|||||||
Reference in New Issue
Block a user