From fffe330bbccee617cac6d84d1f4097133de82e44 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Thu, 20 Mar 2014 15:32:12 +0100 Subject: Fix parameter order for Storage\Local::hash --- lib/private/files/storage/local.php | 2 +- lib/private/files/storage/mappedlocal.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php index a62230bdba5..071b12ffbd5 100644 --- a/lib/private/files/storage/local.php +++ b/lib/private/files/storage/local.php @@ -256,7 +256,7 @@ if (\OC_Util::runningOnWindows()) { return 0; } - public function hash($path, $type, $raw = false) { + public function hash($type, $path, $raw = false) { return hash_file($type, $this->datadir . $path, $raw); } diff --git a/lib/private/files/storage/mappedlocal.php b/lib/private/files/storage/mappedlocal.php index 1bab3489a28..cb5ab6902e6 100644 --- a/lib/private/files/storage/mappedlocal.php +++ b/lib/private/files/storage/mappedlocal.php @@ -276,7 +276,7 @@ class MappedLocal extends \OC\Files\Storage\Common{ return 0; } - public function hash($path, $type, $raw=false) { + public function hash($type, $path, $raw=false) { return hash_file($type, $this->buildPath($path), $raw); } -- cgit v1.2.3 From 7a8f1389fec7db92e1da4f4d46bf0b2737bd3482 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 21 Mar 2014 13:23:14 +0100 Subject: fix temporary file based common hash --- lib/private/files/storage/common.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/private/files/storage/common.php b/lib/private/files/storage/common.php index 3c078d7b1b4..2b697141515 100644 --- a/lib/private/files/storage/common.php +++ b/lib/private/files/storage/common.php @@ -160,8 +160,7 @@ abstract class Common implements \OC\Files\Storage\Storage { public function hash($type, $path, $raw = false) { $tmpFile = $this->getLocalFile($path); - $hash = hash($type, $tmpFile, $raw); - unlink($tmpFile); + $hash = hash_file($type, $tmpFile, $raw); return $hash; } -- cgit v1.2.3