summaryrefslogtreecommitdiffstats
path: root/lib/filesystemview.php
diff options
context:
space:
mode:
authorMichael Gapczynski <GapczynskiM@gmail.com>2012-04-01 02:38:26 -0400
committerMichael Gapczynski <GapczynskiM@gmail.com>2012-04-01 02:38:26 -0400
commit6bb48b2731185dd93ad1a1edc52f33725cd99061 (patch)
tree0546c5b8ad5bb692649a75e1d2db188db70c6d39 /lib/filesystemview.php
parentdaf742c086fefab9d715be3308088e626de1216c (diff)
downloadnextcloud-server-6bb48b2731185dd93ad1a1edc52f33725cd99061.tar.gz
nextcloud-server-6bb48b2731185dd93ad1a1edc52f33725cd99061.zip
Check file handle exists before trying to read file
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r--lib/filesystemview.php15
1 files changed, 9 insertions, 6 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php
index 39e47975b28..a3736f1976c 100644
--- a/lib/filesystemview.php
+++ b/lib/filesystemview.php
@@ -137,13 +137,16 @@ class OC_FilesystemView {
}
public function readfile($path){
$handle=$this->fopen($path,'r');
- $chunkSize = 1024*1024;// 1 MB chunks
- while (!feof($handle)) {
- echo fread($handle, $chunkSize);
- @ob_flush();
- flush();
+ if ($handle) {
+ $chunkSize = 1024*1024;// 1 MB chunks
+ while (!feof($handle)) {
+ echo fread($handle, $chunkSize);
+ @ob_flush();
+ flush();
+ }
+ return $this->filesize($path);
}
- return $this->filesize($path);
+ return false;
}
public function is_readable($path){
return $this->basicOperation('is_readable',$path);