From d9f23c0578c37bc9c61a7e2f8196027d6841fd75 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 17 Apr 2015 14:25:57 +0200 Subject: [PATCH 1/2] fixing undefined variable --- apps/encryption/controller/statuscontroller.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/encryption/controller/statuscontroller.php b/apps/encryption/controller/statuscontroller.php index fc06d7f86a..d29cca0350 100644 --- a/apps/encryption/controller/statuscontroller.php +++ b/apps/encryption/controller/statuscontroller.php @@ -59,30 +59,30 @@ class StatusController extends Controller { */ public function getStatus() { + $status = 'error'; + $message = ''; switch( $this->session->getStatus()) { case Session::INIT_EXECUTED: $status = 'success'; $message = (string)$this->l->t( 'Invalid private key for Encryption App. Please update your private' . ' key password in your personal settings to recover access to your' - . ' encrypted files.', array('app' => 'encryption')); + . ' encrypted files.'); break; case Session::NOT_INITIALIZED: $status = 'success'; $message = (string)$this->l->t( 'Encryption App is enabled but your keys are not initialized,' - . ' please log-out and log-in again', array('app' => 'encryption')); + . ' please log-out and log-in again'); break; - default: - $status = 'error'; } return new DataResponse( - array( + [ 'status' => $status, - 'data' => array( - 'message' => $message) - ) + 'data' => [ + 'message' => $message] + ] ); } From 2e803fd2cd2b17c32da4a76c8d97743edf20c65c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20M=C3=BCller?= Date: Fri, 17 Apr 2015 14:26:58 +0200 Subject: [PATCH 2/2] Do not concat translation string --- apps/encryption/controller/statuscontroller.php | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/apps/encryption/controller/statuscontroller.php b/apps/encryption/controller/statuscontroller.php index d29cca0350..ef3d70a0b4 100644 --- a/apps/encryption/controller/statuscontroller.php +++ b/apps/encryption/controller/statuscontroller.php @@ -65,15 +65,14 @@ class StatusController extends Controller { case Session::INIT_EXECUTED: $status = 'success'; $message = (string)$this->l->t( - 'Invalid private key for Encryption App. Please update your private' - . ' key password in your personal settings to recover access to your' - . ' encrypted files.'); + 'Invalid private key for Encryption App. Please update your private key password in your personal settings to recover access to your encrypted files.' + ); break; case Session::NOT_INITIALIZED: $status = 'success'; $message = (string)$this->l->t( - 'Encryption App is enabled but your keys are not initialized,' - . ' please log-out and log-in again'); + 'Encryption App is enabled but your keys are not initialized, please log-out and log-in again' + ); break; }