From c728b1f0703b832c1cb69f4b296c405874bbeb4d Mon Sep 17 00:00:00 2001 From: Roeland Jago Douma Date: Wed, 19 May 2021 10:09:48 +0200 Subject: Properly log expiration date removal in audit log Signed-off-by: Roeland Jago Douma --- apps/admin_audit/lib/Actions/Sharing.php | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/apps/admin_audit/lib/Actions/Sharing.php b/apps/admin_audit/lib/Actions/Sharing.php index fb070c565a7..472e4203110 100644 --- a/apps/admin_audit/lib/Actions/Sharing.php +++ b/apps/admin_audit/lib/Actions/Sharing.php @@ -320,15 +320,26 @@ class Sharing extends Action { * @param array $params */ public function updateExpirationDate(array $params): void { - $this->log( - 'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"', - $params, - [ - 'itemType', - 'itemSource', - 'date', - ] - ); + if ($params['date'] === null) { + $this->log( + 'The expiration date of the publicly shared %s with ID "%s" has been changed removed', + $params, + [ + 'itemType', + 'itemSource', + ] + ); + } else { + $this->log( + 'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"', + $params, + [ + 'itemType', + 'itemSource', + 'date', + ] + ); + } } /** -- cgit v1.2.3