diff options
author | Morris Jobke <hey@morrisjobke.de> | 2015-07-30 13:57:04 +0200 |
---|---|---|
committer | Morris Jobke <hey@morrisjobke.de> | 2016-10-19 00:15:01 +0200 |
commit | cc28f82b369c2e8ebf2d0b4390379b9cda4af40b (patch) | |
tree | 3681f1e92af5a4bc0c581d3314e5cb37b00dd63a /lib/private/DB/AdapterMySQL.php | |
parent | 972e560e7274cf25021b1a5095206640b063789a (diff) | |
download | nextcloud-server-cc28f82b369c2e8ebf2d0b4390379b9cda4af40b.tar.gz nextcloud-server-cc28f82b369c2e8ebf2d0b4390379b9cda4af40b.zip |
Add config option to update charset of mysql to utf8mb4
* fully optional
* requires additional options set in the database
Diffstat (limited to 'lib/private/DB/AdapterMySQL.php')
-rw-r--r-- | lib/private/DB/AdapterMySQL.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/private/DB/AdapterMySQL.php b/lib/private/DB/AdapterMySQL.php index 3e2fceda8db..0c0c6b31021 100644 --- a/lib/private/DB/AdapterMySQL.php +++ b/lib/private/DB/AdapterMySQL.php @@ -39,7 +39,8 @@ class AdapterMySQL extends Adapter { } public function fixupStatement($statement) { - $statement = str_replace(' ILIKE ', ' COLLATE utf8_general_ci LIKE ', $statement); + $characterSet = \OC::$server->getConfig()->getSystemValue('mysql.utf8mb4', false) ? 'utf8mb4' : 'utf8'; + $statement = str_replace(' ILIKE ', ' COLLATE ' . $characterSet . '_general_ci LIKE ', $statement); return $statement; } } |