Avoid PHP error when false is passed to PMA_DBI_getError.
This can be caused by controllink set to false.
This commit is contained in:
@@ -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'];
|
||||
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user