]> source.dussan.org Git - nextcloud-server.git/commitdiff
Return plausible isReadable() default impl for ext storage
authorVincent Petry <pvince81@owncloud.com>
Thu, 21 Nov 2013 18:15:11 +0000 (19:15 +0100)
committerVincent Petry <pvince81@owncloud.com>
Fri, 22 Nov 2013 17:21:17 +0000 (18:21 +0100)
When an ext storage doesn't implement isReadable(), always returning
true made the file scanner believe that the file exists and creates a
cache entry with the size zero.

This fix makes the default impl of isReadable() use file_exists().

Fixes #5940

apps/files_external/lib/streamwrapper.php

index 4a63dfb6e0277b6c6fd9d5286fe7a42257ba7f9f..a086f411f573b0005c53d82ca9df9e1699687043 100644 (file)
@@ -42,11 +42,16 @@ abstract class StreamWrapper extends Common {
        }
 
        public function isReadable($path) {
-               return true; //not properly supported
+               // at least check whether it exists
+               // subclasses might want to implement this more thoroughly
+               return $this->file_exists($path);
        }
 
        public function isUpdatable($path) {
-               return true; //not properly supported
+               // at least check whether it exists
+               // subclasses might want to implement this more thoroughly
+               // a non-existing file/folder isn't updatable
+               return $this->file_exists($path);
        }
 
        public function file_exists($path) {