diff options
author | Robin Appelman <icewind@owncloud.com> | 2012-03-03 00:55:17 +0100 |
---|---|---|
committer | Robin Appelman <icewind@owncloud.com> | 2012-03-03 00:57:52 +0100 |
commit | 1794ad353d90d8168ae592a192353f1375473462 (patch) | |
tree | 9a6a64a5f69b0fe508a2551e0c608aba0354c218 /lib/filestorage | |
parent | 3e84f170e7133d9acc46123ba4c901a24e438b2c (diff) | |
download | nextcloud-server-1794ad353d90d8168ae592a192353f1375473462.tar.gz nextcloud-server-1794ad353d90d8168ae592a192353f1375473462.zip |
fix file_get_content on empty files for filestorage common
Diffstat (limited to 'lib/filestorage')
-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"); |