Skip to content

Commit 393877e

Browse files
authored
Merge pull request #27324 from nextcloud/stable21-backport-27024
[stable21] Properly log expiration date removal in audit log
2 parents 6e190b1 + 6300a1b commit 393877e

File tree

1 file changed

+20
-9
lines changed

1 file changed

+20
-9
lines changed

apps/admin_audit/lib/Actions/Sharing.php

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -320,15 +320,26 @@ public function updatePassword(array $params) {
320320
* @param array $params
321321
*/
322322
public function updateExpirationDate(array $params) {
323-
$this->log(
324-
'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"',
325-
$params,
326-
[
327-
'itemType',
328-
'itemSource',
329-
'date',
330-
]
331-
);
323+
if ($params['date'] === null) {
324+
$this->log(
325+
'The expiration date of the publicly shared %s with ID "%s" has been removed',
326+
$params,
327+
[
328+
'itemType',
329+
'itemSource',
330+
]
331+
);
332+
} else {
333+
$this->log(
334+
'The expiration date of the publicly shared %s with ID "%s" has been changed to "%s"',
335+
$params,
336+
[
337+
'itemType',
338+
'itemSource',
339+
'date',
340+
]
341+
);
342+
}
332343
}
333344

334345
/**

0 commit comments

Comments
 (0)