apparently it's a bad idea to do is_resource() on a mysqli result

This commit is contained in:
Andrew Dolgov 2015-07-12 14:23:32 +03:00
parent 83ce77a2e8
commit ec57104d6e
2 changed files with 3 additions and 3 deletions

View File

@ -700,7 +700,7 @@ class API extends Handler {
'id' => $feed_id, 'id' => $feed_id,
'is_cat' => $is_cat); 'is_cat' => $is_cat);
if (is_resource($result)) { if (!is_numeric($result)) {
while ($line = db_fetch_assoc($result)) { while ($line = db_fetch_assoc($result)) {
$line["content_preview"] = truncate_string(strip_tags($line["content"]), $excerpt_length); $line["content_preview"] = truncate_string(strip_tags($line["content"]), $excerpt_length);
foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) { foreach (PluginHost::getInstance()->get_hooks(PluginHost::HOOK_QUERY_HEADLINES) as $p) {

View 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; $lnum = $offset;
@ -753,7 +753,7 @@ class Feeds extends Handler_Protected {
if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info); if ($_REQUEST["debug"]) $timing_info = print_checkpoint("PE", $timing_info);
} else if (is_resource($result)) { } else if (!is_numeric($result)) {
$message = ""; $message = "";
switch ($view_mode) { switch ($view_mode) {