diff options
author | Joas Schilling <coding@schilljs.com> | 2017-05-11 10:57:20 +0200 |
---|---|---|
committer | Joas Schilling <coding@schilljs.com> | 2017-05-11 10:58:21 +0200 |
commit | 65efb388e660dbb10b73e622dd776a8ee8618f1d (patch) | |
tree | 7ef2a7eb663626ae4969fafb83369a331c317ae2 /lib/private/Files | |
parent | f1ef5fc5379f9acad16f412648ff44e9266805c1 (diff) | |
download | nextcloud-server-65efb388e660dbb10b73e622dd776a8ee8618f1d.tar.gz nextcloud-server-65efb388e660dbb10b73e622dd776a8ee8618f1d.zip |
Actually we want to update the mimetype of all files ending with the suffix
Signed-off-by: Joas Schilling <coding@schilljs.com>
Diffstat (limited to 'lib/private/Files')
-rw-r--r-- | lib/private/Files/Type/Loader.php | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php index bc3c2f1c9e6..41093689094 100644 --- a/lib/private/Files/Type/Loader.php +++ b/lib/private/Files/Type/Loader.php @@ -158,7 +158,7 @@ class Loader implements IMimeTypeLoader { * @return int number of changed rows */ public function updateFilecache($ext, $mimetypeId) { - $is_folderId = $this->getId('httpd/unix-directory'); + $isFolderId = $this->getId('httpd/unix-directory'); $update = $this->dbConnection->getQueryBuilder(); $update->update('filecache') ->set('mimetype', $update->createNamedParameter($mimetypeId)) @@ -166,10 +166,11 @@ class Loader implements IMimeTypeLoader { 'mimetype', $update->createNamedParameter($mimetypeId) )) ->andwhere($update->expr()->neq( - 'mimetype', $update->createNamedParameter($is_folderId) + 'mimetype', $update->createNamedParameter($isFolderId) )) ->andWhere($update->expr()->like( - $update->createFunction('LOWER(`name`)'), $update->createNamedParameter($ext) + $update->createFunction('LOWER(' . $update->getColumnName('name') . ')'), + '%' . $this->dbConnection->escapeLikeParameter($update->createNamedParameter('.' . $ext)) )); return $update->execute(); } |