Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion maintain.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,22 @@ function install($plugin_version, &$errors=array())
`name` varchar(128) NULL DEFAULT NULL,
`email` varchar(128) NULL DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8
) ENGINE=MyISAM DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci
;');

// --- charset upgrade (utf8 -> utf8mb4) ---
$result = pwg_query("SHOW TABLE STATUS LIKE '" . $this->table . "';");
if ($result and $row = pwg_db_fetch_assoc($result)) {
if (strpos($row['Collation'], 'utf8mb4') !== 0) {
pwg_query("
ALTER TABLE `" . $this->table . "`
CONVERT TO CHARACTER SET utf8mb4
COLLATE utf8mb4_general_ci
;
");
}
}

// configuration
if (empty($conf['ContactForm']))
{
Expand Down