]> git.wh0rd.org - tt-rss.git/commitdiff
apparently it's a bad idea to do is_resource() on a mysqli result
authorAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 11:23:32 +0000 (14:23 +0300)
committerAndrew Dolgov <noreply@fakecake.org>
Sun, 12 Jul 2015 11:23:32 +0000 (14:23 +0300)
classes/api.php
classes/feeds.php

index 2691625c7bfab7fb5df79ae2d07f306d19a3c06f..648d6ca6ec1b8cd3e226d23fe476b7a8f2b38619 100644 (file)
@@ -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) {
index d1caf3c259b5b1a4999ab58f8202648fe585a5e8..508ad988a7be89400a7972dcbaf2b0d2f24920f6 100644 (file)
@@ -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) {