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:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user