From 95ef0e2d2820b2dcb2e63bcdfe4131b487a4b200 Mon Sep 17 00:00:00 2001 From: Marc Delisle Date: Sun, 25 Nov 2007 12:54:32 +0000 Subject: [PATCH] if no default server is set, cannot check the client library --- main.php | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/main.php b/main.php index e0d5c8831..c2acf9e1b 100644 --- a/main.php +++ b/main.php @@ -290,16 +290,18 @@ if ($GLOBALS['using_mb_charset'] && !@extension_loaded('mbstring')) { * (a difference on the third digit does not count). * If someday there is a constant that we can check about mysqlnd, we can use it instead * of strpos(). + * If no default server is set, PMA_DBI_get_client_info() is not defined yet. */ -$_client_info = PMA_DBI_get_client_info(); -if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) { - trigger_error(PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion, - $_client_info, - substr(PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-')))), - E_USER_NOTICE); +if (function_exists('PMA_DBI_get_client_info')) { + $_client_info = PMA_DBI_get_client_info(); + if ($server > 0 && strpos($_client_info, 'mysqlnd') === false && substr(PMA_MYSQL_CLIENT_API, 0, 3) != substr(PMA_MYSQL_INT_VERSION, 0, 3)) { + trigger_error(PMA_sanitize(sprintf($strMysqlLibDiffersServerVersion, + $_client_info, + substr(PMA_MYSQL_STR_VERSION, 0, strpos(PMA_MYSQL_STR_VERSION . '-', '-')))), + E_USER_NOTICE); + } + unset($_client_info); } -unset($_client_info); - /** * prints list item for main page *