From 03146789859c002dc85326154282859bbfe43848 Mon Sep 17 00:00:00 2001 From: "Cezary H. Noweta" Date: Sat, 5 Jul 2014 09:28:06 -0400 Subject: [PATCH] bug #4478 Server validation does not work while in setup/mysqli Signed-off-by: Marc Delisle --- libraries/config/Validator.class.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libraries/config/Validator.class.php b/libraries/config/Validator.class.php index d332259c89..af3281b542 100644 --- a/libraries/config/Validator.class.php +++ b/libraries/config/Validator.class.php @@ -225,13 +225,15 @@ class PMA_Validator $error_key = 'Server' ) { // static::testPHPErrorMsg(); - $socket = empty($socket) || $connect_type == 'tcp' ? null : $socket; - $port = empty($port) || $connect_type == 'socket' ? null : ':' . $port; $error = null; if (PMA_DatabaseInterface::checkDbExtension('mysqli')) { + $socket = empty($socket) || $connect_type == 'tcp' ? null : $socket; + $port = empty($port) || $connect_type == 'socket' ? null : $port; $extension = 'mysqli'; } else { + $socket = empty($socket) || $connect_type == 'tcp' ? null : ':' . ($socket[0] == '/' ? '' : '/') . $socket; + $port = empty($port) || $connect_type == 'socket' ? null : ':' . $port; $extension = 'mysql'; } @@ -266,7 +268,7 @@ class PMA_Validator break; } } else if ($extension == 'mysql') { - $conn = @mysql_connect($host . $socket . $port, $user, $pass); + $conn = @mysql_connect($host . $port . $socket, $user, $pass); if (! $conn) { $error = __('Could not connect to the database server!'); } else {