From ec57104d6e221a2a44752d6f68615055eefea1db Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Sun, 12 Jul 2015 14:23:32 +0300 Subject: [PATCH] apparently it's a bad idea to do is_resource() on a mysqli result --- classes/api.php | 2 +- classes/feeds.php | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/classes/api.php b/classes/api.php index 2691625c..648d6ca6 100644 --- a/classes/api.php +++ b/classes/api.php @@ -700,7 +700,7 @@ class API extends Handler { 'id' => $feed_id, 'is_cat' => $is_cat); - if (is_resource($result)) { + if (!is_numeric($result)) { while ($line = db_fetch_assoc($result)) { $line["content_preview"] = truncate_string(strip_tags($line["content"]), $excerpt_length); foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { diff --git a/classes/feeds.php b/classes/feeds.php index d1caf3c2..508ad988 100644 --- a/classes/feeds.php +++ b/classes/feeds.php @@ -295,7 +295,7 @@ class Feeds extends Handler_Protected { } } - if (is_resource($result) && $this->dbh->num_rows($result) > 0) { + if (!is_numeric($result) && $this->dbh->num_rows($result) > 0) { $lnum = $offset; @@ -753,7 +753,7 @@ class Feeds extends Handler_Protected { if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info); - } else if (is_resource($result)) { + } else if (!is_numeric($result)) { $message = ""; switch ($view_mode) { -- 2.39.5