diff options
author | Andy Staudacher <andy.st@gmail.com> | 2010-02-14 17:07:31 -0800 |
---|---|---|
committer | Andy Staudacher <andy.st@gmail.com> | 2010-02-14 17:07:31 -0800 |
commit | 824087416a2469cf044b4a9193a0047c6c889333 (patch) | |
tree | 1d6ed02a442628a3a3c7dcfa5202e9e91a95ab86 /installer | |
parent | 74471df7770784887bd44cfbe02f48ec12bf8532 (diff) |
Avoid PHP warnings when the DB host string has no port.
Diffstat (limited to 'installer')
-rw-r--r-- | installer/installer.php | 2 | ||||
-rw-r--r-- | installer/web.php | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/installer/installer.php b/installer/installer.php index 57be6cc0..705f1725 100644 --- a/installer/installer.php +++ b/installer/installer.php @@ -77,7 +77,7 @@ class installer { // counterparts. if (!function_exists("mysql_query")) { function mysql_connect($host, $user, $pass) { - list ($host, $port) = explode(":", $host); + list ($host, $port) = explode(":", $host . ":"); installer::$mysqli = new mysqli($host, $user, $pass, $port); // http://php.net/manual/en/mysqli.connect.php says to use mysqli_connect_error() instead of // $mysqli->connect_error because of bugs before PHP 5.2.9 diff --git a/installer/web.php b/installer/web.php index 90143afb..0a3cdb6e 100644 --- a/installer/web.php +++ b/installer/web.php @@ -38,7 +38,7 @@ if (installer::already_installed()) { "dbname" => $_POST["dbname"], "prefix" => $_POST["prefix"], "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql"); - list ($config["host"], $config["port"]) = explode(":", $config["host"]); + list ($config["host"], $config["port"]) = explode(":", $config["host"] . ":"); if (!installer::connect($config)) { $content = render("invalid_db_info.html.php"); |