Skip to content

Commit 7f68bc3

Browse files
committed
Add default value for database character set
1 parent c818ec7 commit 7f68bc3

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

library/Notifications/Common/Database.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,13 @@ private static function getConnection(): Connection
8282
. ",NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'";
8383
}
8484

85+
if (empty($config->charset)) {
86+
$config->charset = match ($config->db) {
87+
'mysql' => 'utf8mb4',
88+
default => 'utf8',
89+
};
90+
}
91+
8592
$db = new Connection($config);
8693

8794
$adapter = $db->getAdapter();

0 commit comments

Comments
 (0)