]> source.dussan.org Git - nextcloud-server.git/commitdiff
Prepare for #2013 fix
authorMichael Gapczynski <mtgap@owncloud.com>
Fri, 17 May 2013 15:42:14 +0000 (11:42 -0400)
committerVictor Dubiniuk <victor.dubiniuk@gmail.com>
Sat, 3 Aug 2013 12:38:18 +0000 (15:38 +0300)
apps/files_external/lib/google.php

index 3f7a9877f782e99805a0d4b4a25bca041094e380..36b890e82e8f09bda23a741efd57bdf99e5672d9 100644 (file)
@@ -248,7 +248,13 @@ class Google extends \OC\Files\Storage\Common {
                        if ($this->filetype($path) === 'dir') {
                                $stat['size'] = 0;
                        } else {
-                               $stat['size'] = $file->getFileSize();
+                               // Check if this is a Google Doc
+                               if ($this->getMimeType($path) !== $file->getMimeType()) {
+                                       // Return unknown file size
+                                       $stat['size'] = \OC\Files\Filesystem::FREE_SPACE_UNKNOWN;
+                               } else {
+                                       $stat['size'] = $file->getFileSize();
+                               }
                        }
                        $stat['atime'] = strtotime($file->getLastViewedByMeDate());
                        $stat['mtime'] = strtotime($file->getModifiedDate());