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:
Michal Čihař
2010-08-23 17:02:15 +02:00
parent 1e7bc7d691
commit a24e418527
2 changed files with 11 additions and 0 deletions

View File

@@ -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'];

View File

@@ -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