summaryrefslogtreecommitdiff
path: root/adodb-exceptions.inc.php
diff options
context:
space:
mode:
authorMike <Mike-Benoit@users.noreply.github.com>2022-01-01 14:34:39 -0800
committerGitHub <noreply@github.com>2022-01-01 23:34:39 +0100
commitf3d56fd8a2affb3eedd2ab82b200f3c66b66daf0 (patch)
treed823241107a32f17610fa9e10c2db90e947b27bc /adodb-exceptions.inc.php
parent94f39ba56f3cd719b43535d1b0e92f5b644083a7 (diff)
downloadadodb-f3d56fd8a2affb3eedd2ab82b200f3c66b66daf0.tar.gz
adodb-f3d56fd8a2affb3eedd2ab82b200f3c66b66daf0.tar.bz2
adodb-f3d56fd8a2affb3eedd2ab82b200f3c66b66daf0.zip
Prevent PHP warning if P1 or P2 happen to be an array
When an SQL error is triggered and ADOdb attempts to output an error message, if the parameters happen to be arrays this will prevent a PHP WARNING from occurring. Fixes #783 Co-authored-by: Mike-Benoit <mikeb@timetrex.com>
Diffstat (limited to 'adodb-exceptions.inc.php')
-rw-r--r--adodb-exceptions.inc.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/adodb-exceptions.inc.php b/adodb-exceptions.inc.php
index 9f1176f0..560286a1 100644
--- a/adodb-exceptions.inc.php
+++ b/adodb-exceptions.inc.php
@@ -45,6 +45,9 @@ var $database = '';
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, '$user', '****', $p2)";
break;
default:
+ //Prevent PHP warning if $p1 or $p2 are arrays.
+ $p1 = ( is_array($p1) ) ? 'Array' : $p1;
+ $p2 = ( is_array($p2) ) ? 'Array' : $p2;
$s = "$dbms error: [$errno: $errmsg] in $fn($p1, $p2)";
break;
}