From 5922832b6d1eb6f058827c03c9960278c4fe372d Mon Sep 17 00:00:00 2001 From: Cameron Date: Tue, 4 Dec 2012 00:13:49 -0800 Subject: [PATCH] Make sure new tables are utf8. --- e107_handlers/plugin_class.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/e107_handlers/plugin_class.php b/e107_handlers/plugin_class.php index 753c7c5cc..8d9d74ad1 100644 --- a/e107_handlers/plugin_class.php +++ b/e107_handlers/plugin_class.php @@ -882,6 +882,8 @@ class e107plugin function manage_tables($action, $var) { $sql = e107::getDB(); + $mes = e107::getMessage(); + if (!is_array($var)) return FALSE; // Return if nothing to do $error = false; @@ -891,6 +893,13 @@ class e107plugin case 'add': foreach ($var as $tab) { + + if(!preg_match("/MyISAM.*CHARSET ?= ?utf8/i",$tab)) + { + $tab = str_replace("MyISAM", "MyISAM DEFAULT CHARSET=utf8", $tab); + } + + $mes->addDebug($tab); if (false === $sql->db_Query($tab)) { $error = true;