From d9cbf2664c77c52fd7b334a67798d31e3b8e99e4 Mon Sep 17 00:00:00 2001 From: Tim Siebels Date: Thu, 24 Jul 2014 17:49:16 +0200 Subject: [PATCH] Fix default port to null for hhvm HHVM doesn't allow false to be passed as port to mysqli_real_connect. It only allows a nullable integer until ZendParamMode is finished. See facebook/hhvm#1817 Signed-off-by: Tim Siebels --- libraries/DatabaseInterface.class.php | 4 ++-- libraries/dbi/DBIMysql.class.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/libraries/DatabaseInterface.class.php b/libraries/DatabaseInterface.class.php index 91accfecf2..232e00aba2 100644 --- a/libraries/DatabaseInterface.class.php +++ b/libraries/DatabaseInterface.class.php @@ -2300,7 +2300,7 @@ class PMA_DatabaseInterface * * @param array|null $server host/port/socket/persistent * - * @return false|integer + * @return null|integer */ public function getServerPort($server = null) { @@ -2309,7 +2309,7 @@ class PMA_DatabaseInterface } if (empty($server['port'])) { - return false; + return null; } else { return intval($server['port']); } diff --git a/libraries/dbi/DBIMysql.class.php b/libraries/dbi/DBIMysql.class.php index 2170db0b87..256085e36f 100644 --- a/libraries/dbi/DBIMysql.class.php +++ b/libraries/dbi/DBIMysql.class.php @@ -99,7 +99,7 @@ class PMA_DBI_Mysql implements PMA_DBI_Extension $server_port = $GLOBALS['dbi']->getServerPort($server); $server_socket = $GLOBALS['dbi']->getServerSocket($server); - if ($server_port === false) { + if ($server_port === null) { $server_port = ''; } else { $server_port = ':' . $server_port;