From 5855377579850556ccfb7d667d5b5fdcc406b7dd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Mon, 29 Jul 2013 22:04:18 +0000 Subject: [PATCH] Better use isValidSqlLink() (driver-dependent) than is_resource() which worked only with now deprecated MySQL extension --- inc/ajax/ajax_installer.php | 2 +- inc/sql-functions.php | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/inc/ajax/ajax_installer.php b/inc/ajax/ajax_installer.php index 0031a183cd..5e6bf0d664 100644 --- a/inc/ajax/ajax_installer.php +++ b/inc/ajax/ajax_installer.php @@ -62,7 +62,7 @@ function establishAjaxInstallerDatabaseLink () { $linkResource = sqlConnectToDatabase(getSession('mysql_host'), getSession('mysql_login'), getSession('mysql_password1'), __FUNCTION__, __LINE__); // Is this a link resource? - if (!is_resource($linkResource)) { + if (!isValidSqlLink($linkResource)) { // Is not a resource reportBug(__FUNCTION__, __LINE__, 'linkResource[]=' . gettype($linkResource) . ', expected: link resource'); } elseif (!isSqlLinkUp()) { diff --git a/inc/sql-functions.php b/inc/sql-functions.php index 9e82b02daf..cc16793be7 100644 --- a/inc/sql-functions.php +++ b/inc/sql-functions.php @@ -585,7 +585,7 @@ function ifSqlTableExists ($tableName) { array($tableName), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here @@ -630,7 +630,7 @@ function ifSqlTableColumnExists ($tableName, $columnName, $forceFound = FALSE) { ), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here @@ -672,7 +672,7 @@ function ifSqlTableIndexExist ($tableName, $keyName, $forceFound = FALSE) { $result = sqlQueryEscaped("SHOW INDEX FROM `%s`", array($tableName), __FUNCTION__, __LINE__); // Is a link there? - if (!is_resource($result)) { + if (!isValidSqlLink($result)) { // Is installation phase? if (isInstaller()) { // Then silently abort here -- 2.30.2