]> source.dussan.org Git - nextcloud-server.git/commitdiff
Send "SET NAMES utf8" to MySQL for PHP below 5.3.6
authorAndreas Fischer <bantu@owncloud.com>
Tue, 10 Dec 2013 23:13:40 +0000 (00:13 +0100)
committerAndreas Fischer <bantu@owncloud.com>
Tue, 10 Dec 2013 23:19:51 +0000 (00:19 +0100)
lib/private/db.php

index 1e5d12649df0be92dedd794e5408cb7fade84b33..562065259fa6fb0c02a00e6599498ed3b4e4adda 100644 (file)
@@ -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(