fix file_get_content on empty files for filestorage common

remotes/origin/stable4
Robin Appelman 13 years ago
parent 3e84f170e7
commit 1794ad353d
  1. 9
      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");

Loading…
Cancel
Save