summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoas Schilling <coding@schilljs.com>2016-10-18 10:22:02 +0200
committerMorris Jobke <hey@morrisjobke.de>2016-10-19 00:15:01 +0200
commit9356a0e5830a82ddcf48d52ffc48a8fb8f7b68a7 (patch)
treede0ba943c58bb3ea3c33795af5ac7bb995eef2dc
parentd294ef23dde27b22c1c96e576b50753a724e4189 (diff)
downloadnextcloud-server-9356a0e5830a82ddcf48d52ffc48a8fb8f7b68a7.tar.gz
nextcloud-server-9356a0e5830a82ddcf48d52ffc48a8fb8f7b68a7.zip
Correctly save and pass on the charset
Signed-off-by: Joas Schilling <coding@schilljs.com>
-rw-r--r--lib/private/DB/ConnectionFactory.php6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/private/DB/ConnectionFactory.php b/lib/private/DB/ConnectionFactory.php
index 8a1ed60b257..adb180da0c0 100644
--- a/lib/private/DB/ConnectionFactory.php
+++ b/lib/private/DB/ConnectionFactory.php
@@ -67,7 +67,7 @@ class ConnectionFactory {
public function __construct(IConfig $config) {
if($config->getSystemValue('mysql.utf8mb4', false)) {
- $defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
+ $this->defaultConnectionParams['mysql']['charset'] = 'utf8mb4';
}
}
@@ -106,7 +106,9 @@ class ConnectionFactory {
case 'mysql':
// Send "SET NAMES utf8". Only required on PHP 5.3 below 5.3.6.
// See http://stackoverflow.com/questions/4361459/php-pdo-charset-set-names#4361485
- $eventManager->addEventSubscriber(new MysqlSessionInit);
+ $eventManager->addEventSubscriber(new MysqlSessionInit(
+ $this->defaultConnectionParams['mysql']['charset']
+ ));
$eventManager->addEventSubscriber(
new SQLSessionInit("SET SESSION AUTOCOMMIT=1"));
break;