1
0

Only set mysqli_set_charset when covnersion is enabled

This restores the behaviour from before the move to utf8mb4 and should help legacy blogs not having charset issues, that went from latin1 to utf8 to now utf8mb4
This commit is contained in:
onli
2020-03-28 13:29:56 +01:00
parent 261bac42f1
commit b718cf7726

View File

@@ -247,16 +247,17 @@ function serendipity_db_connect() {
function serendipity_db_reconnect() {
global $serendipity;
$use_charset = '';
if (isset($serendipity['dbCharset']) && !empty($serendipity['dbCharset'])) {
$use_charset = $serendipity['dbCharset'];
@define('SQL_CHARSET_INIT', true);
} elseif (defined('SQL_CHARSET') && $serendipity['dbNames'] && !defined('SQL_CHARSET_INIT')) {
$use_charset = SQL_CHARSET;
} else {
$use_charset = 'utf8';
}
mysqli_set_charset($serendipity['dbConn'], $use_charset);
if ($use_charset != '') {
mysqli_set_charset($serendipity['dbConn'], $use_charset);
}
}
/**