From f3e2a63712e3306c5bb1cad1921da4a3ff542474 Mon Sep 17 00:00:00 2001
From: Bjoern Schiessle <schiessle@owncloud.com>
Date: Wed, 20 Nov 2013 12:34:23 +0100
Subject: [PATCH] check if it is a cached file or a version to resolve the
 correct path to the file key

---
 apps/files_encryption/lib/util.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 4f27c2b00f..b208a808ba 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -472,7 +472,11 @@ class Util {
 	 */
 	public function isEncryptedPath($path) {
 
-		$relPath = Helper::stripUserFilesPath($path);
+		$relPath = Helper::getPathToRealFile($path);
+
+		if ($relPath === false) {
+			$relPath = Helper::stripUserFilesPath($path);
+		}
 
 		$fileKey = Keymanager::getFileKey($this->view, $relPath);
 
-- 
GitLab