From a07065ab8cee81e959d769992e6d021218b5cfa8 Mon Sep 17 00:00:00 2001 From: Guillermo Pages Date: Mon, 27 Sep 2021 12:16:42 +0200 Subject: [PATCH] fix: false < 6 is true --- src/Db/Connection.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Db/Connection.php b/src/Db/Connection.php index f33d4c3..226e0e8 100644 --- a/src/Db/Connection.php +++ b/src/Db/Connection.php @@ -32,7 +32,8 @@ class Connection throw new SqlException('SQL There was an error executing the request'); } - if ((strpos($sql, "SELECT") < 6 || strpos($sql, "OUTPUT INSERTED") !== false) && (($hasOutput !== null && $hasOutput !== false) || $hasOutput === null)) { + $selectPos = strpos($sql, "SELECT"); + if ((($selectPos !== false && $selectPos < 6) || strpos($sql, "OUTPUT INSERTED") !== false) && (($hasOutput !== null && $hasOutput !== false) || $hasOutput === null)) { $rows = $statement->fetchAll($fetchMode); if (!is_array($rows)) { throw new SqlException('PDO Unable to retrieve the result');