r79767 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r79766‎ | r79767 | r79768 >
Date:22:43, 6 January 2011
Author:demon
Status:ok
Tags:
Comment:
(bug 25969) Allow hyphens in db name/prefix. Lots of duplication here :(
Modified paths:
  • /trunk/phase3/includes/installer/Installer.i18n.php (modified) (history)
  • /trunk/phase3/includes/installer/MysqlInstaller.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/installer/Installer.i18n.php
@@ -234,9 +234,9 @@
235235 'config-invalid-db-server-oracle' => 'Invalid database TNS "$1".
236236 Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and dots (.).',
237237 'config-invalid-db-name' => 'Invalid database name "$1".
238 -Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).',
 238+Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).',
239239 'config-invalid-db-prefix' => 'Invalid database prefix "$1".
240 -Use only ASCII letters (a-z, A-Z), numbers (0-9) and underscores (_).',
 240+Use only ASCII letters (a-z, A-Z), numbers (0-9), underscores (_) and hyphens (-).',
241241 'config-connection-error' => '$1.
242242
243243 Check the host, username and password below and try again.',
Index: trunk/phase3/includes/installer/MysqlInstaller.php
@@ -76,10 +76,10 @@
7777 $status = Status::newGood();
7878 if ( !strlen( $newValues['wgDBname'] ) ) {
7979 $status->fatal( 'config-missing-db-name' );
80 - } elseif ( !preg_match( '/^[a-zA-Z0-9_]+$/', $newValues['wgDBname'] ) ) {
 80+ } elseif ( !preg_match( '/^[a-z0-9_-]+$/i', $newValues['wgDBname'] ) ) {
8181 $status->fatal( 'config-invalid-db-name', $newValues['wgDBname'] );
8282 }
83 - if ( !preg_match( '/^[a-zA-Z0-9_]*$/', $newValues['wgDBprefix'] ) ) {
 83+ if ( !preg_match( '/^[a-z0-9_-]*$/i', $newValues['wgDBprefix'] ) ) {
8484 $status->fatal( 'config-invalid-db-prefix', $newValues['wgDBprefix'] );
8585 }
8686 if ( !$status->isOK() ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r80081DB name can have hyphens (fixed in r79767), bug 26685 pointed out the message...demon08:57, 12 January 2011
r801901.17: MFT first batch of installer changes: r78043, r78231, r78259, r78300, r...catrope20:47, 13 January 2011

Status & tagging log