diff options
author | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-25 16:54:46 -0400 |
---|---|---|
committer | Michael Gapczynski <mtgap@owncloud.com> | 2012-07-25 16:55:01 -0400 |
commit | f25ccaff59c135d7f1f22196bf266916ef131b35 (patch) | |
tree | d11baa501500bbb3bc25ab9b2beecfc9a03de47e /lib/filesystemview.php | |
parent | 37bccf54f27288b99468467457a4740f32745366 (diff) | |
download | nextcloud-server-f25ccaff59c135d7f1f22196bf266916ef131b35.tar.gz nextcloud-server-f25ccaff59c135d7f1f22196bf266916ef131b35.zip |
Fix filesystem hash, no longer using basicOperation()
Diffstat (limited to 'lib/filesystemview.php')
-rw-r--r-- | lib/filesystemview.php | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/filesystemview.php b/lib/filesystemview.php index 9beda01e5a1..3c989d7c36f 100644 --- a/lib/filesystemview.php +++ b/lib/filesystemview.php @@ -465,8 +465,27 @@ class OC_FilesystemView { public function getMimeType($path) { return $this->basicOperation('getMimeType', $path); } - public function hash($type, $path) { - return $this->basicOperation('hash', $path, array('read'), $type); + public function hash($type, $path, $raw = false) { + $absolutePath = $this->getAbsolutePath($path); + if (OC_FileProxy::runPreProxies('hash', $absolutePath) && OC_Filesystem::isValidPath($path)) { + $path = $this->getRelativePath($absolutePath); + if ($path == null) { + return false; + } + if (OC_Filesystem::$loaded && $this->fakeRoot == OC_Filesystem::getRoot()) { + OC_Hook::emit( + OC_Filesystem::CLASSNAME, + OC_Filesystem::signal_read, + array( OC_Filesystem::signal_param_path => $path) + ); + } + if ($storage = $this->getStorage($path)) { + $result = $storage->hash($type, $this->getInternalPath($path), $raw); + $result = OC_FileProxy::runPostProxies('hash', $absolutePath, $result); + return $result; + } + } + return null; } public function free_space($path='/') { |