diff options
author | Robin Appelman <icewind@owncloud.com> | 2014-03-20 15:35:01 +0100 |
---|---|---|
committer | Andreas Fischer <bantu@owncloud.com> | 2014-04-02 04:38:54 +0200 |
commit | 54a15a80011e50e7b7b9cf9c946c5bd5e82df42b (patch) | |
tree | 00129a930a812a3d477bc585642cf0f548441b6a /lib | |
parent | 70db348475164ad595d3f7863b078df9efb236dc (diff) | |
download | nextcloud-server-54a15a80011e50e7b7b9cf9c946c5bd5e82df42b.tar.gz nextcloud-server-54a15a80011e50e7b7b9cf9c946c5bd5e82df42b.zip |
Use streams when generating hashes of remote files
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/storage/common.php | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 2b697141515..05e031b37ad 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -159,9 +159,11 @@ abstract class Common implements \OC\Files\Storage\Storage { } public function hash($type, $path, $raw = false) { - $tmpFile = $this->getLocalFile($path); - $hash = hash_file($type, $tmpFile, $raw); - return $hash; + $fh = $this->fopen($path, 'r'); + $ctx = hash_init($type); + hash_update_stream($ctx, $fh); + fclose($fh); + return hash_final($ctx, $raw); } public function search($query) { |