From 517c108cc4a83cd14d9f02beec300a5c481ab771 Mon Sep 17 00:00:00 2001 From: Johannes Meyer Date: Mon, 26 Jul 2021 16:36:26 +0200 Subject: [PATCH] UserGroupBackend: Always use `utf8` as db connection charset --- .../Icinga/Authentication/UserGroup/UserGroupBackend.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/Icinga/Authentication/UserGroup/UserGroupBackend.php b/library/Icinga/Authentication/UserGroup/UserGroupBackend.php index 6513002f5..2a5948823 100644 --- a/library/Icinga/Authentication/UserGroup/UserGroupBackend.php +++ b/library/Icinga/Authentication/UserGroup/UserGroupBackend.php @@ -164,8 +164,13 @@ class UserGroupBackend $name ); } - $resource = ResourceFactory::create($backendConfig->resource); + $resourceConfig = ResourceFactory::getResourceConfig($backendConfig->resource); + if ($backendType === 'db') { + $resourceConfig->charset = 'utf8'; + } + + $resource = ResourceFactory::createResource($resourceConfig); switch ($backendType) { case 'db': $backend = new DbUserGroupBackend($resource);