}\r
}\r
\r
- if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {\r
+ if (is_numeric($feed) && $feed > 0) {\r
\r
$result = db_query($this->link, "SELECT rtl_content FROM ttrss_feeds\r
WHERE id = '$feed' AND owner_uid = " . $_SESSION["uid"]);\r
set_pref($this->link, "_DEFAULT_VIEW_ORDER_BY", $order_by);\r
set_pref($this->link, "_DEFAULT_INCLUDE_CHILDREN", $include_children);\r
\r
- if (!$cat_view && preg_match("/^[0-9][0-9]*$/", $feed)) {\r
+ if (!$cat_view && is_numeric($feed) && $feed > 0) {\r
db_query($this->link, "UPDATE ttrss_feeds SET last_viewed = NOW()\r
WHERE id = '$feed' AND owner_uid = ".$_SESSION["uid"]);\r
}\r
$query_strategy_part = "ttrss_entries.id > 0";
$vfeed_query_part = "ttrss_feeds.title AS feed_title,";
/* tags */
- } else if (preg_match("/^-?[0-9][0-9]*$/", $feed) == false) {
+ } else if (!is_numeric($feed)) {
$query_strategy_part = "ttrss_entries.id > 0";
$vfeed_query_part = "(SELECT title FROM ttrss_feeds WHERE
id = feed_id) as feed_title,";
$content_query_part = "content as content_preview,";
- if (preg_match("/^-?[0-9][0-9]*$/", $feed) != false) {
+ if (is_numeric($feed)) {
if ($feed >= 0) {
$feed_kind = "Feeds";