From b5fb0da98f636cb670c6e4a3562c32ebdfe81462 Mon Sep 17 00:00:00 2001 From: "Michael Kaufmann (d00p)" Date: Tue, 12 Mar 2013 08:14:52 +0100 Subject: [PATCH] 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) --- install/updates/froxlor/0.9/update_0.9.inc.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/install/updates/froxlor/0.9/update_0.9.inc.php b/install/updates/froxlor/0.9/update_0.9.inc.php index 842622aa..9db69d1d 100644 --- a/install/updates/froxlor/0.9/update_0.9.inc.php +++ b/install/updates/froxlor/0.9/update_0.9.inc.php @@ -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;'); } }