diff options
Diffstat (limited to 'apps/files_encryption/lib/helper.php')
-rwxr-xr-x | apps/files_encryption/lib/helper.php | 11 |
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(); } /** |