From: Rob Church Date: Fri, 29 Dec 2006 11:59:47 +0000 (+0000) Subject: (bug 6449) Throw a more definitive error message when installation fails due to an... X-Git-Tag: 1.31.0-rc.0~54746 X-Git-Url: http://git.cyclocoop.org/%28?a=commitdiff_plain;h=3c558237fd199f5abe8aa92ca034a5e235c23078;p=lhc%2Fweb%2Fwiklou.git (bug 6449) Throw a more definitive error message when installation fails due to an invalid database name --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 4afa1647e7..bc5a5925e8 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -425,6 +425,8 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN Linux systems with at least some versions of PHP * (bug 5908) Allow overriding the default category sort key for all items on a page using {{DEFAULTSORT}} +* (bug 6449) Throw a more definitive error message when installation fails + due to an invalid database name == Languages updated == diff --git a/config/index.php b/config/index.php index 26aa3ec5d0..830b1e408c 100644 --- a/config/index.php +++ b/config/index.php @@ -793,11 +793,16 @@ if( $conf->posted && ( 0 == count( $errs ) ) ) { print "
  • Database " . htmlspecialchars( $wgDBname ) . " exists
  • \n"; } else { $err = mysql_errno(); - if ( $err != 1049 ) { - print ""; + $databaseSafe = htmlspecialchars( $wgDBname ); + if( $err == 1102 /* Invalid database name */ ) { + print ""; + continue; + } elseif( $err != 1049 /* Database doesn't exist */ ) { + print ""; continue; } + print "
  • Attempting to create database...
  • "; $res = $wgDatabase->query( "CREATE DATABASE `$wgDBname`" ); if( !$res ) { print "
  • Couldn't create database " .