From f6371180083570c677bf676d4debaa6833c83068 Mon Sep 17 00:00:00 2001 From: Florin Peter Date: Tue, 4 Jun 2013 00:41:47 +0200 Subject: [PATCH] better handling for http post --- apps/files_encryption/files/error.php | 4 ++++ apps/files_encryption/lib/helper.php | 6 +++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/files_encryption/files/error.php b/apps/files_encryption/files/error.php index 3118299b519..37e94e5658f 100644 --- a/apps/files_encryption/files/error.php +++ b/apps/files_encryption/files/error.php @@ -4,6 +4,10 @@ if (!isset($_)) { //also provide standalone error page $l = OC_L10N::get('files_encryption'); + if(isset($_GET['p']) && $_GET['p'] === '1') { + header('HTTP/1.0 404 ' . $l->t('Your private key is not valid! Maybe the your password was changed from outside.')); + } + // check if ajax request if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { \OCP\JSON::error(array('data' => array('message' => $l->t('Your private key is not valid! Maybe the your password was changed from outside.')))); diff --git a/apps/files_encryption/lib/helper.php b/apps/files_encryption/lib/helper.php index 40e12ae367f..a22c139c503 100755 --- a/apps/files_encryption/lib/helper.php +++ b/apps/files_encryption/lib/helper.php @@ -201,7 +201,11 @@ class Helper { */ public static function redirectToErrorPage() { $location = \OC_Helper::linkToAbsolute('apps/files_encryption/files', 'error.php'); - header('Location: ' . $location); + $post = 0; + if(count($_POST) > 0) { + $post = 1; + } + header('Location: ' . $location . '?p=' . $post); exit(); } } \ No newline at end of file -- 2.39.5