summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndreas Fischer <bantu@owncloud.com>2013-12-11 00:13:40 +0100
committerAndreas Fischer <bantu@owncloud.com>2013-12-11 00:19:51 +0100
commitcdd182ce356b697d0c1d029c1f7fe64277d8410f (patch)
tree7d6b6570f889863bd82be901e3e5f4b49fff04dd /lib
parent28180485d9d767a081656e403fe7c8210957f976 (diff)
downloadnextcloud-server-cdd182ce356b697d0c1d029c1f7fe64277d8410f.tar.gz
nextcloud-server-cdd182ce356b697d0c1d029c1f7fe64277d8410f.zip
Send "SET NAMES utf8" to MySQL for PHP below 5.3.6
Diffstat (limited to 'lib')
-rw-r--r--lib/private/db.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/db.php b/lib/private/db.php
index 1e5d12649df..562065259fa 100644
--- a/lib/private/db.php
+++ b/lib/private/db.php
@@ -101,6 +101,9 @@ class OC_DB {
);
$connectionParams['adapter'] = '\OC\DB\Adapter';
$connectionParams['wrapperClass'] = 'OC\DB\Connection';
+ // 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 \Doctrine\DBAL\Event\Listeners\MysqlSessionInit);
break;
case 'pgsql':
$connectionParams = array(