]> source.dussan.org Git - nextcloud-server.git/commitdiff
remove obsolete hack (#26928) 3298/head
authorJörn Friedrich Dreyer <jfd@butonic.de>
Thu, 12 Jan 2017 15:07:41 +0000 (16:07 +0100)
committerMorris Jobke <hey@morrisjobke.de>
Fri, 27 Jan 2017 18:20:48 +0000 (12:20 -0600)
* remove obsolete hack

> // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961
was closed 4 years ago. we could also use the Common implementation

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
lib/private/Files/Storage/Local.php

index 4fe7dcafbbfcb44263dee0604845f9d2555a5b97..80d48680be13841bc2a0c95d77c818a87c00035a 100644 (file)
@@ -205,18 +205,7 @@ class Local extends \OC\Files\Storage\Common {
        }
 
        public function file_get_contents($path) {
-               // file_get_contents() has a memory leak: https://bugs.php.net/bug.php?id=61961
-               $fileName = $this->getSourcePath($path);
-
-               $fileSize = filesize($fileName);
-               if ($fileSize === 0) {
-                       return '';
-               }
-
-               $handle = fopen($fileName, 'rb');
-               $content = fread($handle, $fileSize);
-               fclose($handle);
-               return $content;
+               return file_get_contents($this->getSourcePath($path));
        }
 
        public function file_put_contents($path, $data) {