summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2013-11-21 19:15:11 +0100
committerVincent Petry <pvince81@owncloud.com>2013-11-22 18:21:17 +0100
commita49e873d3fa513136bfdf1d71bbc2bbcd61d3650 (patch)
treeb7760fc677e12be2c2ca84f38566f04f1521722a /apps
parentaeefe48cba49a869bfe93cdf10cc3da79914e080 (diff)
downloadnextcloud-server-a49e873d3fa513136bfdf1d71bbc2bbcd61d3650.tar.gz
nextcloud-server-a49e873d3fa513136bfdf1d71bbc2bbcd61d3650.zip
Return plausible isReadable() default impl for ext storage
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
Diffstat (limited to 'apps')
-rw-r--r--apps/files_external/lib/streamwrapper.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index 4a63dfb6e02..a086f411f57 100644
--- a/apps/files_external/lib/streamwrapper.php
+++ b/apps/files_external/lib/streamwrapper.php
@@ -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) {