1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-03 21:27:25 +02:00

Make sure new tables are utf8.

This commit is contained in:
Cameron
2012-12-04 00:13:49 -08:00
parent a9eeb7372d
commit 5922832b6d

View File

@@ -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;