From fa9c96ac4f2801db453023b86e41431374b52260 Mon Sep 17 00:00:00 2001 From: Vincent Petry Date: Tue, 7 Jun 2016 16:29:23 +0200 Subject: [PATCH] Fix GDrive file size when mime type doesn't match contents Uploading a txt file with XML contents makes GDrive return the XML mime type. This fix makes sure the logic that returns "SPACE_UNKNOWN" for the size properly rely on the Google Docs mime types. --- apps/files_external/lib/Lib/Storage/Google.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apps/files_external/lib/Lib/Storage/Google.php b/apps/files_external/lib/Lib/Storage/Google.php index 49fde7d066..96f12800c1 100644 --- a/apps/files_external/lib/Lib/Storage/Google.php +++ b/apps/files_external/lib/Lib/Storage/Google.php @@ -326,7 +326,7 @@ class Google extends \OC\Files\Storage\Common { $stat['size'] = 0; } else { // Check if this is a Google Doc - if ($this->getMimeType($path) !== $file->getMimeType()) { + if ($this->isGoogleDocFile($file)) { // Return unknown file size $stat['size'] = \OCP\Files\FileInfo::SPACE_UNKNOWN; } else {