Set utf8 as database charset, use utf8mb4 if possible for mysql
For serendipity_config_local.inc.php, see https://github.com/s9y/Serendipity/issues/747
This commit is contained in:
parent
931e621549
commit
674319b36b
@ -109,7 +109,11 @@ function serendipity_updateLocalConfig($dbName, $dbPrefix, $dbHost, $dbUser, $db
|
||||
fwrite($configfp, "\t\$serendipity['dbType'] = '" . addslashes($dbType) . "';\n");
|
||||
fwrite($configfp, "\t\$serendipity['dbPersistent'] = ". (serendipity_db_bool($dbPersistent) ? 'true' : 'false') .";\n");
|
||||
if ($serendipity['dbNames']) {
|
||||
fwrite($configfp, "\t\$serendipity['dbCharset'] = '" . addslashes(SQL_CHARSET) . "';\n");
|
||||
if (($dbType == 'mysqli' || $dbType == 'mysql') && SQL_CHARSET == 'utf8' && serendipity_utf8mb4_ready()) {
|
||||
fwrite($configfp, "\t\$serendipity['dbCharset'] = 'utf8mb4';\n");
|
||||
} else {
|
||||
fwrite($configfp, "\t\$serendipity['dbCharset'] = '" . addslashes(SQL_CHARSET) . "';\n");
|
||||
}
|
||||
}
|
||||
|
||||
if (is_array($privateVariables) && count($privateVariables) > 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user