From 35877b13825b2c3db44ff89977344b84f8e21d9a Mon Sep 17 00:00:00 2001 From: Mario Date: Thu, 10 Feb 2022 18:57:44 +0000 Subject: allow to override the DB charset via the $db_charset variable in .htconfig.php --- boot.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'boot.php') diff --git a/boot.php b/boot.php index 5da93beae..004413a85 100644 --- a/boot.php +++ b/boot.php @@ -664,12 +664,17 @@ function sys_boot() { require_once('include/dba/dba_driver.php'); if (!App::$install) { - DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, App::$install); + + if (empty($db_charset)) { + $db_charset = ((intval($db_type) === 0) ? 'utf8mb4' : 'UTF8'); + } + + DBA::dba_factory($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, $db_charset, App::$install); if (!DBA::$dba->connected) { system_unavailable(); } - unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type); + unset($db_host, $db_port, $db_user, $db_pass, $db_data, $db_type, $db_charset); /* * Load configs from db. Overwrite configs from .htconfig.php -- cgit v1.2.3