diff --git a/libraries/dbi/mysql.dbi.lib.php b/libraries/dbi/mysql.dbi.lib.php index 4750ee225..bf1611450 100644 --- a/libraries/dbi/mysql.dbi.lib.php +++ b/libraries/dbi/mysql.dbi.lib.php @@ -321,6 +321,12 @@ function PMA_DBI_get_client_info() function PMA_DBI_getError($link = null) { $GLOBALS['errno'] = 0; + + /* Treat false same as null because of controllink */ + if ($link === false) { + $link = null; + } + if (null === $link && isset($GLOBALS['userlink'])) { $link =& $GLOBALS['userlink']; diff --git a/libraries/dbi/mysqli.dbi.lib.php b/libraries/dbi/mysqli.dbi.lib.php index 9672385df..2c00bcdbc 100644 --- a/libraries/dbi/mysqli.dbi.lib.php +++ b/libraries/dbi/mysqli.dbi.lib.php @@ -379,6 +379,11 @@ function PMA_DBI_getError($link = null) { $GLOBALS['errno'] = 0; + /* Treat false same as null because of controllink */ + if ($link === false) { + $link = null; + } + if (null === $link && isset($GLOBALS['userlink'])) { $link =& $GLOBALS['userlink']; // Do not stop now. We still can get the error code