]> source.dussan.org Git - nextcloud-server.git/commitdiff
don´t change folders with --repair-filecache
authorRello <Rello@users.noreply.github.com>
Tue, 18 Apr 2017 19:41:52 +0000 (21:41 +0200)
committerJoas Schilling <coding@schilljs.com>
Thu, 11 May 2017 08:40:48 +0000 (10:40 +0200)
check if folder is "httpd/unix-directory" and don´t perform here #27585

lib/private/Files/Type/Loader.php

index 4dd798e7b070a127b7058bd7007ee386e98dae1a..bc3c2f1c9e647ef7fe26fcf3085fbb47b1403d68 100644 (file)
@@ -158,12 +158,16 @@ class Loader implements IMimeTypeLoader {
         * @return int number of changed rows
         */
        public function updateFilecache($ext, $mimetypeId) {
+               $is_folderId = $this->getId('httpd/unix-directory');
                $update = $this->dbConnection->getQueryBuilder();
                $update->update('filecache')
                        ->set('mimetype', $update->createNamedParameter($mimetypeId))
                        ->where($update->expr()->neq(
                                'mimetype', $update->createNamedParameter($mimetypeId)
                        ))
+                       ->andwhere($update->expr()->neq(
+                               'mimetype', $update->createNamedParameter($is_folderId)
+                       ))
                        ->andWhere($update->expr()->like(
                                $update->createFunction('LOWER(`name`)'), $update->createNamedParameter($ext)
                        ));