(bug 26688) Proper warning message is not displayed for the blank 'Database host'
authorChad Horohoe <demon@users.mediawiki.org>
Wed, 12 Jan 2011 09:59:55 +0000 (09:59 +0000)
committerChad Horohoe <demon@users.mediawiki.org>
Wed, 12 Jan 2011 09:59:55 +0000 (09:59 +0000)
includes/installer/Installer.i18n.php
includes/installer/MysqlInstaller.php

index 954b21d..eeefd75 100644 (file)
@@ -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 (.).',
index 44b07d9..57f44c1 100644 (file)
@@ -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'] ) ) {