diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 4f27c2b00fb1811e921279150a2089846fdb3319..b208a808bacb705c60e04589db146e4d7b230e98 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);