BUGFIX #2342: Database names with hyphens and other special characters can now be used.

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@69715 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-01-05 20:57:48 +00:00
parent 63de49eab1
commit f28715775d
2 changed files with 3 additions and 3 deletions

View File

@ -124,8 +124,8 @@ class MySQLDatabase extends Database {
}
public function createDatabase() {
$this->query("CREATE DATABASE $this->database");
$this->query("USE $this->database");
$this->query("CREATE DATABASE `$this->database`");
$this->query("USE `$this->database`");
$this->tableList = $this->fieldList = $this->indexList = null;

View File

@ -107,7 +107,7 @@
<label for="mysql_password">MySQL password:</label>
<span class="middleColumn"><input id="mysql_password" class="text" type="password" name="mysql[password]" value="<?php echo $databaseConfig['password']; ?>" /></span>
<label for="mysql_database">MySQL database:</label>
<span class="middleColumn"><input id="mysql_database" class="text" type="text" name="mysql[database]" value="<?php echo $databaseConfig['database']; ?>" onchange="this.value = this.value.replace(/[^A-Za-z0-9_]+/g,'');" /></span>
<span class="middleColumn"><input id="mysql_database" class="text" type="text" name="mysql[database]" value="<?php echo $databaseConfig['database']; ?>" onchange="this.value = this.value.replace(/[\/\\:*?&quot;<>|. \t]+/g,'');" /></span>
<input type="submit" class="action" value="Re-check requirements" />
</p>
<p class="mysql">SilverStripe stores its content in a MySQL database. Please provide the username and password to connect to the server here. If this account has permission to create databases, then we will create the database for you; otherwise, you must give the name of a database that already exists.</p>