Skip to content

Commit

Permalink
Explicitly handle false in makeDbCall()
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
alanseiden authored Sep 18, 2020
1 parent 464bbdd commit 045a809
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ToolkitApi/Toolkit.php
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 045a809

Please sign in to comment.