[Pkg-owncloud-commits] [owncloud] 06/95: check if cache files are readable

David Prévot taffit at moszumanska.debian.org
Wed Mar 11 15:49:43 UTC 2015


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

taffit pushed a commit to annotated tag v8.0.1
in repository owncloud.

commit de0c16789ed0f9ab2180709146031326ad65a0de
Author: Jörn Friedrich Dreyer <jfd at butonic.de>
Date:   Mon Feb 2 23:19:54 2015 +0100

    check if cache files are readable
    
    :camel:case
    
    readd is_file
---
 lib/private/cache/file.php       | 2 +-
 lib/private/cache/fileglobal.php | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/private/cache/file.php b/lib/private/cache/file.php
index 4e7c065..3b500c4 100644
--- a/lib/private/cache/file.php
+++ b/lib/private/cache/file.php
@@ -83,7 +83,7 @@ class File {
 
 	public function hasKey($key) {
 		$storage = $this->getStorage();
-		if ($storage && $storage->is_file($key)) {
+		if ($storage && $storage->is_file($key) && $storage->isReadable($key)) {
 			return true;
 		}
 		return false;
diff --git a/lib/private/cache/fileglobal.php b/lib/private/cache/fileglobal.php
index d9e0fd4..8406ada 100644
--- a/lib/private/cache/fileglobal.php
+++ b/lib/private/cache/fileglobal.php
@@ -52,7 +52,7 @@ class FileGlobal {
 	public function hasKey($key) {
 		$key = $this->fixKey($key);
 		$cache_dir = self::getCacheDir();
-		if ($cache_dir && is_file($cache_dir.$key)) {
+		if ($cache_dir && is_file($cache_dir.$key) && is_readable($cache_dir.$key)) {
 			$mtime = filemtime($cache_dir.$key);
 			if ($mtime < time()) {
 				unlink($cache_dir.$key);

-- 
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