summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorThomas Müller <thomas.mueller@tmit.eu>2014-03-14 18:20:33 +0100
committerThomas Müller <thomas.mueller@tmit.eu>2014-03-14 18:20:33 +0100
commitbbbbb033f32353ef1582a6f90305c4ad01e2390a (patch)
tree57869eaa34bae99e58fbfd862493efe76c543177 /apps
parentfe05c0c81bba1e2203f6ec5c8fbe1007281e1d45 (diff)
downloadnextcloud-server-bbbbb033f32353ef1582a6f90305c4ad01e2390a.tar.gz
nextcloud-server-bbbbb033f32353ef1582a6f90305c4ad01e2390a.zip
in case of phpunit executions calling header() and exit() is too bad
Diffstat (limited to 'apps')
-rwxr-xr-xapps/files_encryption/lib/helper.php11
1 files changed, 8 insertions, 3 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();
}
/**