aboutsummaryrefslogtreecommitdiffstats
path: root/apps/files_encryption/lib
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_encryption/lib')
-rwxr-xr-xapps/files_encryption/lib/helper.php11
-rw-r--r--apps/files_encryption/lib/proxy.php9
-rw-r--r--apps/files_encryption/lib/util.php1
3 files changed, 17 insertions, 4 deletions
diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php
index ef3775875f0..8cbbe8a45a6 100755
--- a/apps/files_encryption/lib/helper.php
+++ b/apps/files_encryption/lib/helper.php
@@ -367,9 +367,14 @@ class Helper {
$post = 0;
if(count($_POST) > 0) {
$post = 1;
- }
- header('Location: ' . $location . '?p=' . $post . '&errorCode=' . $errorCode);
- exit();
+ }
+
+ if(defined('PHPUNIT_RUN') and PHPUNIT_RUN) {
+ throw new \Exception("Encryption error: $errorCode");
+ }
+
+ header('Location: ' . $location . '?p=' . $post . '&errorCode=' . $errorCode);
+ exit();
}
/**
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index a2d42c22c13..6549273c8f1 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -128,6 +128,8 @@ class Proxy extends \OC_FileProxy {
// re-enable proxy - our work is done
\OC_FileProxy::$enabled = $proxyStatus;
+ } else {
+ return false;
}
}
}
@@ -340,6 +342,13 @@ class Proxy extends \OC_FileProxy {
// if path is a folder do nothing
if ($view->is_dir($path)) {
+ $proxyState = \OC_FileProxy::$enabled;
+ \OC_FileProxy::$enabled = false;
+ $fileInfo = $view->getFileInfo($path);
+ \OC_FileProxy::$enabled = $proxyState;
+ if (isset($fileInfo['unencrypted_size']) && $fileInfo['unencrypted_size'] > 0) {
+ return $fileInfo['unencrypted_size'];
+ }
return $size;
}
diff --git a/apps/files_encryption/lib/util.php b/apps/files_encryption/lib/util.php
index 6bf69cd8ee1..3db5a423478 100644
--- a/apps/files_encryption/lib/util.php
+++ b/apps/files_encryption/lib/util.php
@@ -135,7 +135,6 @@ class Util {
// Set directories to check / create
$setUpDirs = array(
$this->userDir,
- $this->userFilesDir,
$this->publicKeyDir,
$this->encryptionDir,
$this->keyfilesPath,