From 903da8652f4d5bac9fca3616437febc3de9de031 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Tue, 1 Jun 2021 15:11:05 +0200 Subject: [PATCH] XMLRPC was enforcing UTF8 for all the requests, enforces utf8mb4 for each queries like it is done in FlexiAPI (see https://github.com/laravel/framework/blob/v5.4.14/src/Illuminate/Database/Connectors/MySqlConnector.php#L55) --- flexisip-account-manager.spec | 2 +- src/database/database.php | 2 +- src/objects/account.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/flexisip-account-manager.spec b/flexisip-account-manager.spec index c4f17e4..7f18c4c 100644 --- a/flexisip-account-manager.spec +++ b/flexisip-account-manager.spec @@ -8,7 +8,7 @@ #%define _datadir %{_datarootdir} #%define _docdir %{_datadir}/doc -%define build_number 75 +%define build_number 76 %define var_dir /var/opt/belledonne-communications %define opt_dir /opt/belledonne-communications/share/flexisip-account-manager diff --git a/src/database/database.php b/src/database/database.php index 56e0235..4a9d7ef 100644 --- a/src/database/database.php +++ b/src/database/database.php @@ -46,7 +46,7 @@ class Database $this->conn = new PDO("mysql:host=" . DB_HOST . ";dbname=" . DB_NAME, DB_USER, DB_PASSWORD); } - $this->conn->exec("set names utf8"); + $this->conn->prepare("set names utf8mb4 collate utf8mb4_unicode_ci")->execute(); } catch (PDOException $exception) { Logger::getInstance()->error("Connection error: " . $exception->getMessage()); } diff --git a/src/objects/account.php b/src/objects/account.php index d0a2087..3909571 100644 --- a/src/objects/account.php +++ b/src/objects/account.php @@ -185,7 +185,7 @@ class Account $this->activated = "1"; return true; } - + Logger::getInstance()->error($stmt->errorInfo()); return false; }