mirror of
https://github.com/e107inc/e107.git
synced 2025-07-31 20:00:37 +02:00
Fixes #252 - Database creation issue during install. Added input validation on database name.
This commit is contained in:
@@ -54,7 +54,7 @@ define("LANINS_029", "Table prefix:");
|
|||||||
define("LANINS_030", "The MySQL server you would like e107 to use. It can also include a port number. e.g. “hostname:port” or a path to a local socket e.g. \":/path/to/socket\" for the localhost.");
|
define("LANINS_030", "The MySQL server you would like e107 to use. It can also include a port number. e.g. “hostname:port” or a path to a local socket e.g. \":/path/to/socket\" for the localhost.");
|
||||||
define("LANINS_031", "The username you wish e107 to use to connect to your MySQL server");
|
define("LANINS_031", "The username you wish e107 to use to connect to your MySQL server");
|
||||||
define("LANINS_032", "The Password for the user you just entered");
|
define("LANINS_032", "The Password for the user you just entered");
|
||||||
define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist.");
|
define("LANINS_033", "The MySQL database you wish e107 to reside in, sometimes referred to as a schema. Must begin with a lowercase letter. If the user has database create permissions you can opt to create the database automatically if it doesn't already exist.");
|
||||||
define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema.");
|
define("LANINS_034", "The prefix you wish e107 to use when creating the e107 tables. Useful for multiple installs of e107 in one database schema.");
|
||||||
define("LANINS_035", "Continue");
|
define("LANINS_035", "Continue");
|
||||||
define("LANINS_036", "3");
|
define("LANINS_036", "3");
|
||||||
|
10
install.php
10
install.php
@@ -417,9 +417,9 @@ class e_install
|
|||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td><label for='db'>".LANINS_027."</label></td>
|
<td><label for='db'>".LANINS_027."</label></td>
|
||||||
<td>
|
<td class='form-inline'>
|
||||||
<input type='text' name='db' size='20' id='db' value='' maxlength='100' required='required' />
|
<input type='text' name='db' size='20' id='db' value='' maxlength='100' required='required' pattern='^[a-z][a-z0-9_-]*' />
|
||||||
<label class='checkbox inline'><input type='checkbox' name='createdb' value='1' />".LANINS_028."</label>
|
<label class='checkbox inline'><input type='checkbox' name='createdb' value='1' /><small>".LANINS_028."</small></label>
|
||||||
<span class='field-help'>".LANINS_033."</span>
|
<span class='field-help'>".LANINS_033."</span>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -580,11 +580,11 @@ class e_install
|
|||||||
|
|
||||||
if($this->previous_steps['mysql']['createdb'] == 1 || !$DB_ALREADY_EXISTS)
|
if($this->previous_steps['mysql']['createdb'] == 1 || !$DB_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
$query = 'CREATE DATABASE '.$this->previous_steps['mysql']['db'].' CHARACTER SET `utf8` ';
|
$query = 'CREATE DATABASE `'.$this->previous_steps['mysql']['db'].'` CHARACTER SET `utf8` ';
|
||||||
}
|
}
|
||||||
elseif($DB_ALREADY_EXISTS)
|
elseif($DB_ALREADY_EXISTS)
|
||||||
{
|
{
|
||||||
$query = 'ALTER DATABASE '.$this->previous_steps['mysql']['db'].' CHARACTER SET `utf8` ';
|
$query = 'ALTER DATABASE `'.$this->previous_steps['mysql']['db'].'` CHARACTER SET `utf8` ';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$this->dbqry($query))
|
if (!$this->dbqry($query))
|
||||||
|
Reference in New Issue
Block a user