]> git.mxchange.org Git - friendica.git/commitdiff
Bugfix: When a query fails we mustn't use the result value.
authorMichael <heluecht@pirati.ca>
Thu, 16 Mar 2017 09:23:12 +0000 (09:23 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 16 Mar 2017 09:23:12 +0000 (09:23 +0000)
include/dba.php

index 4b0498ad3cb5cd0b469c20d22d7de0ba4da87b53..62728acaed0294ba467cb126cd5ed022f1329e95 100644 (file)
@@ -234,7 +234,9 @@ class dba {
                        case 'pdo':
                                $result = @$this->db->query($sql);
                                // Is used to separate between queries that returning data - or not
-                               $columns = $result->columnCount();
+                               if (!is_bool($result)) {
+                                       $columns = $result->columnCount();
+                               }
                                break;
                        case 'mysqli':
                                $result = @$this->db->query($sql);
@@ -329,7 +331,7 @@ class dba {
                        }
                }
 
-               if (($result === true) || ($result === false)) {
+               if (is_bool($result)) {
                        return $result;
                }
                if ($onlyquery) {