escape database name when converting to UTF-8 as it may contain a dash or similar character that needs escaping, fixes #1172
Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
@@ -1958,14 +1958,14 @@ if(isFroxlorVersion('0.9.28-svn3'))
|
||||
|
||||
showUpdateStep('Altering Froxlor database and tables to use UTF-8. This may take a while..', true);
|
||||
|
||||
$db->query('ALTER DATABASE ' . $db->getDbName() . ' CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||
$db->query('ALTER DATABASE `' . $db->getDbName() . '` CHARACTER SET utf8 COLLATE utf8_general_ci');
|
||||
|
||||
$handle = $db->query('SHOW TABLES');
|
||||
while ($row = $db->fetch_array($handle))
|
||||
{
|
||||
foreach ($row as $table)
|
||||
{
|
||||
$db->query('ALTER TABLE ' . $table . ' CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
||||
$db->query('ALTER TABLE `' . $table . '` CONVERT TO CHARACTER SET utf8 COLLATE utf8_general_ci;');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user