From f77d9573248ed8d9760df13348cb67d696d3cdde Mon Sep 17 00:00:00 2001 From: Chad Horohoe Date: Wed, 12 Jan 2011 09:59:55 +0000 Subject: [PATCH] (bug 26688) Proper warning message is not displayed for the blank 'Database host' --- includes/installer/Installer.i18n.php | 1 + includes/installer/MysqlInstaller.php | 3 +++ 2 files changed, 4 insertions(+) diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 954b21d121..eeefd7531b 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -230,6 +230,7 @@ If you do not see the database system you are trying to use listed below, then f 'config-header-oracle' => 'Oracle settings', 'config-invalid-db-type' => 'Invalid database type', 'config-missing-db-name' => 'You must enter a value for "Database name"', + 'config-missing-db-host' => 'You must enter a value for "Database host"', 'config-missing-db-server-oracle' => 'You must enter a value for "Database TNS"', 'config-invalid-db-server-oracle' => 'Invalid database TNS "$1". Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and dots (.).', diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 44b07d9f03..57f44c104e 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -74,6 +74,9 @@ class MysqlInstaller extends DatabaseInstaller { // Validate them. $status = Status::newGood(); + if ( !strlen( $newValues['wgDBserver'] ) ) { + $status->fatal( 'config-missing-db-host' ); + } if ( !strlen( $newValues['wgDBname'] ) ) { $status->fatal( 'config-missing-db-name' ); } elseif ( !preg_match( '/^[a-z0-9_-]+$/i', $newValues['wgDBname'] ) ) { -- 2.20.1