diff options
Diffstat (limited to 'lib/private/files/storage/local.php')
-rw-r--r-- | lib/private/files/storage/local.php | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index f6f5a8cc130..b6d0ec3fb34 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -176,7 +176,12 @@ class Local extends \OC\Files\Storage\Common { } public function file_get_contents($path) { - return file_get_contents($this->getSourcePath($path)); + // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961 + $filename = $this->getSourcePath($path); + $handle = fopen($filename,'rb'); + $content = fread($handle, filesize($filename)); + fclose($handle); + return $content; } public function file_put_contents($path, $data) { |