diff options
author | Robin Appelman <robin@icewind.nl> | 2016-10-20 14:26:09 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2016-10-20 14:26:09 +0200 |
commit | 3a8e75a814a8c6b394d28570e15ccd85ad57dced (patch) | |
tree | c4ee4ab0a55998864bc345ed9a9ac0583c2f00e3 /lib/private/DB/Connection.php | |
parent | 19b69cbf1b617d6a0b66c2d2f24af4ef81376143 (diff) | |
download | nextcloud-server-3a8e75a814a8c6b394d28570e15ccd85ad57dced.tar.gz nextcloud-server-3a8e75a814a8c6b394d28570e15ccd85ad57dced.zip |
Allow 4byte unicode filenames on supported platforms
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/DB/Connection.php')
-rw-r--r-- | lib/private/DB/Connection.php | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/private/DB/Connection.php b/lib/private/DB/Connection.php index 4fa25aae08d..dfe2e86b617 100644 --- a/lib/private/DB/Connection.php +++ b/lib/private/DB/Connection.php @@ -33,6 +33,7 @@ use Doctrine\DBAL\Driver; use Doctrine\DBAL\Configuration; use Doctrine\DBAL\Cache\QueryCacheProfile; use Doctrine\Common\EventManager; +use Doctrine\DBAL\Platforms\MySqlPlatform; use OC\DB\QueryBuilder\QueryBuilder; use OCP\DB\QueryBuilder\IQueryBuilder; use OCP\IDBConnection; @@ -402,4 +403,14 @@ class Connection extends \Doctrine\DBAL\Connection implements IDBConnection { public function escapeLikeParameter($param) { return addcslashes($param, '\\_%'); } + + /** + * Check whether or not the current database support 4byte wide unicode + * + * @return bool + * @since 9.2.0 + */ + public function supports4ByteText() { + return ! ($this->getDatabasePlatform() instanceof MySqlPlatform && $this->getParams()['charset'] !== 'utf8mb4'); + } } |