From c85a770ecfb3e0824b777aff4e938765e188f561 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 11 May 2017 10:57:20 +0200 Subject: [PATCH] Actually we want to update the mimetype of all files ending with the suffix Signed-off-by: Joas Schilling --- lib/private/Files/Type/Loader.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/private/Files/Type/Loader.php b/lib/private/Files/Type/Loader.php index 357747848a..9dcd21b4d9 100644 --- a/lib/private/Files/Type/Loader.php +++ b/lib/private/Files/Type/Loader.php @@ -159,7 +159,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)) @@ -167,10 +167,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(); }