mirror of
https://github.com/e107inc/e107.git
synced 2025-08-04 13:47:31 +02:00
Make sure new tables are utf8.
This commit is contained in:
@@ -882,6 +882,8 @@ class e107plugin
|
|||||||
function manage_tables($action, $var)
|
function manage_tables($action, $var)
|
||||||
{
|
{
|
||||||
$sql = e107::getDB();
|
$sql = e107::getDB();
|
||||||
|
$mes = e107::getMessage();
|
||||||
|
|
||||||
if (!is_array($var))
|
if (!is_array($var))
|
||||||
return FALSE; // Return if nothing to do
|
return FALSE; // Return if nothing to do
|
||||||
$error = false;
|
$error = false;
|
||||||
@@ -891,6 +893,13 @@ class e107plugin
|
|||||||
case 'add':
|
case 'add':
|
||||||
foreach ($var as $tab)
|
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))
|
if (false === $sql->db_Query($tab))
|
||||||
{
|
{
|
||||||
$error = true;
|
$error = true;
|
||||||
|
Reference in New Issue
Block a user