Actually we want to update the mimetype of all files ending with the suffix

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2017-05-11 10:57:20 +02:00
parent f1ef5fc537
commit 65efb388e6
No known key found for this signature in database
GPG Key ID: E166FD8976B3BAC8
1 changed files with 4 additions and 3 deletions

View File

@ -158,7 +158,7 @@ class Loader implements IMimeTypeLoader {
* @return int number of changed rows * @return int number of changed rows
*/ */
public function updateFilecache($ext, $mimetypeId) { public function updateFilecache($ext, $mimetypeId) {
$is_folderId = $this->getId('httpd/unix-directory'); $isFolderId = $this->getId('httpd/unix-directory');
$update = $this->dbConnection->getQueryBuilder(); $update = $this->dbConnection->getQueryBuilder();
$update->update('filecache') $update->update('filecache')
->set('mimetype', $update->createNamedParameter($mimetypeId)) ->set('mimetype', $update->createNamedParameter($mimetypeId))
@ -166,10 +166,11 @@ class Loader implements IMimeTypeLoader {
'mimetype', $update->createNamedParameter($mimetypeId) 'mimetype', $update->createNamedParameter($mimetypeId)
)) ))
->andwhere($update->expr()->neq( ->andwhere($update->expr()->neq(
'mimetype', $update->createNamedParameter($is_folderId) 'mimetype', $update->createNamedParameter($isFolderId)
)) ))
->andWhere($update->expr()->like( ->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(); return $update->execute();
} }