diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/filestorage/common.php | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/filestorage/common.php b/lib/filestorage/common.php index fa0e7babf56..ed12e67eeb3 100644 --- a/lib/filestorage/common.php +++ b/lib/filestorage/common.php @@ -59,7 +59,14 @@ abstract class OC_Filestorage_Common extends OC_Filestorage { } public function file_get_contents($path) { $handle = $this->fopen($path, "r"); - return fread($handle, $this->filesize($path)); + if(!$handle){ + return false; + } + $size=$this->filesize($path); + if($size==0){ + return ''; + } + return fread($handle, $size); } public function file_put_contents($path,$data) { $handle = $this->fopen($path, "w"); |