[Pkg-owncloud-commits] [owncloud] 37/83: Return plausible isReadable() default impl for ext storage

David Prévot taffit at moszumanska.debian.org
Wed Dec 18 13:05:29 UTC 2013


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch 5.0
in repository owncloud.

commit acd9ea7b2b0595afcc974ea3758e86d5f19cc148
Author: Vincent Petry <pvince81 at owncloud.com>
Date:   Thu Nov 21 19:15:11 2013 +0100

    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().
    
    Backport of a49e873d3fa513136bfdf1d71bbc2bbcd61d3650
---
 apps/files_external/lib/streamwrapper.php | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/apps/files_external/lib/streamwrapper.php b/apps/files_external/lib/streamwrapper.php
index 4a63dfb..a086f41 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) {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list