From 045a809f3d7c075f7fb91984ed596da4191103bf Mon Sep 17 00:00:00 2001 From: Alan Seiden Date: Fri, 18 Sep 2020 14:51:34 -0400 Subject: [PATCH] Explicitly handle false in makeDbCall() Fixes #129 The code's intent was to handle database errors, which return false, but because the code checked for !$outputXml, it interpreted an empty strings as an error, reporting "errors" that were merely empty output. This occurred, for example, when doing a disconnect() with the PDO transport. Now we check for false explicitly. --- ToolkitApi/Toolkit.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ToolkitApi/Toolkit.php b/ToolkitApi/Toolkit.php index 9528d7d..1a46614 100644 --- a/ToolkitApi/Toolkit.php +++ b/ToolkitApi/Toolkit.php @@ -906,7 +906,7 @@ protected function makeDbCall($internalKey, $plugSize, $controlKeyString, $input // can return false if prepare or exec failed. $outputXml = $this->db->execXMLStoredProcedure($this->conn, $sql, $bindArray); - if (!$outputXml) { + if (false === $outputXml) { // if false returned, was a database error (stored proc prepare or execute error) // @todo add ODBC SQL State codes