From: Chad Horohoe Date: Thu, 6 Jan 2011 22:43:46 +0000 (+0000) Subject: (bug 25969) Allow hyphens in db name/prefix. Lots of duplication here :( X-Git-Tag: 1.31.0-rc.0~32735 X-Git-Url: http://git.cyclocoop.org/data/Luca_Pacioli_%28Gemaelde%29.jpeg?a=commitdiff_plain;h=487ada197fdeb560ccf56e593b3ea87e113f0fe0;p=lhc%2Fweb%2Fwiklou.git (bug 25969) Allow hyphens in db name/prefix. Lots of duplication here :( --- diff --git a/includes/installer/Installer.i18n.php b/includes/installer/Installer.i18n.php index 39468f2c16..c99a6148b5 100644 --- a/includes/installer/Installer.i18n.php +++ b/includes/installer/Installer.i18n.php @@ -234,9 +234,9 @@ If you do not see the database system you are trying to use listed below, then f 'config-invalid-db-server-oracle' => 'Invalid database TNS "$1". Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and dots (.).', 'config-invalid-db-name' => 'Invalid database name "$1". -Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).', +Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).', 'config-invalid-db-prefix' => 'Invalid database prefix "$1". -Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).', +Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).', 'config-connection-error' => '$1. Check the host, username and password below and try again.', diff --git a/includes/installer/MysqlInstaller.php b/includes/installer/MysqlInstaller.php index 5f963a2a75..82734f216e 100644 --- a/includes/installer/MysqlInstaller.php +++ b/includes/installer/MysqlInstaller.php @@ -76,10 +76,10 @@ class MysqlInstaller extends DatabaseInstaller { $status = Status::newGood(); if ( !strlen( $newValues['wgDBname'] ) ) { $status->fatal( 'config-missing-db-name' ); - } elseif ( !preg_match( '/^[a-zA-Z0-9_]+$/', $newValues['wgDBname'] ) ) { + } elseif ( !preg_match( '/^[a-z0-9_-]+$/i', $newValues['wgDBname'] ) ) { $status->fatal( 'config-invalid-db-name', $newValues['wgDBname'] ); } - if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBprefix'] ) ) { + if ( !preg_match( '/^[a-z0-9_-]*$/i', $newValues['wgDBprefix'] ) ) { $status->fatal( 'config-invalid-db-prefix', $newValues['wgDBprefix'] ); } if ( !$status->isOK() ) {