From 366df2934040a2a525a1bf1398baf2b8f9f09750 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Thu, 24 Nov 2016 13:58:03 +0100 Subject: [PATCH] Don't log the user password in case something goes wrong Signed-off-by: Joas Schilling --- apps/admin_audit/lib/actions/action.php | 24 +++++++++++++++++------- apps/admin_audit/lib/actions/auth.php | 6 ++++-- 2 files changed, 21 insertions(+), 9 deletions(-) diff --git a/apps/admin_audit/lib/actions/action.php b/apps/admin_audit/lib/actions/action.php index 0525910f8dd..2d036675869 100644 --- a/apps/admin_audit/lib/actions/action.php +++ b/apps/admin_audit/lib/actions/action.php @@ -41,18 +41,28 @@ class Action { * @param string $text * @param array $params * @param array $elements + * @param bool $obfuscateParameters */ public function log($text, array $params, - array $elements) { + array $elements, + $obfuscateParameters = false) { foreach($elements as $element) { if(!isset($params[$element])) { - $this->logger->critical( - sprintf( - '$params["'.$element.'"] was missing. Transferred value: %s', - print_r($params, true) - ) - ); + if ($obfuscateParameters) { + $this->logger->critical( + '$params["'.$element.'"] was missing.', + ['app' => 'admin_audit'] + ); + } else { + $this->logger->critical( + sprintf( + '$params["'.$element.'"] was missing. Transferred value: %s', + print_r($params, true) + ), + ['app' => 'admin_audit'] + ); + } return; } } diff --git a/apps/admin_audit/lib/actions/auth.php b/apps/admin_audit/lib/actions/auth.php index c035cf785fe..405ea5e6d22 100644 --- a/apps/admin_audit/lib/actions/auth.php +++ b/apps/admin_audit/lib/actions/auth.php @@ -34,7 +34,8 @@ class Auth extends Action { $params, [ 'uid', - ] + ], + true ); } @@ -44,7 +45,8 @@ class Auth extends Action { $params, [ 'uid', - ] + ], + true ); } -- 2.39.5