MDL-65896 admin: Fix checking for full unicode support

Instead of checking whether the charset is set to 'utf8' when
determining full unicode support, it should be checking whether the
charset is set to 'utf8mb4'.
This commit is contained in:
Jun Pataleta 2019-10-23 14:08:13 +08:00
parent b412069977
commit b9b10b900d

View File

@ -52,16 +52,12 @@ if ($hassiteconfig) { // speedup for non-admins, add all caps used on this page
$optionalsubsystems->add(new admin_setting_configcheckbox('enableanalytics', new lang_string('enableanalytics', 'admin'),
new lang_string('configenableanalytics', 'admin'), 1, 1, 0));
$fullunicodesupport = true;
if ($DB->get_dbfamily() == 'mysql') {
$collation = $DB->get_dbcollation();
$collationinfo = explode('_', $collation);
$charset = reset($collationinfo);
if ($charset !== 'utf8') {
$fullunicodesupport = false;
}
$fullunicodesupport = $charset === 'utf8mb4';
}
if ($fullunicodesupport) {