Merge pull request #13842 from owncloud/is_file_2_is_readable

check if cache files are readable
This commit is contained in:
Morris Jobke 2015-02-09 23:45:32 +01:00
commit 068f6107c6
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -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);