Skip to content

Commit

Permalink
fix(attachments): allow null expireDate in createShare
Browse files Browse the repository at this point in the history
Signed-off-by: Grigorii K. Shartsev <me@shgk.me>
  • Loading branch information
ShGKme committed May 28, 2024
1 parent 29e65da commit b96446f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/Share/Helper/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ public function formatShare(IShare $share): array {
* @param IShare $share
* @param string $shareWith
* @param int $permissions
* @param string $expireDate
* @param ?string $expireDate
* @throws OCSNotFoundException
*/
public function createShare(IShare $share, string $shareWith, int $permissions, string $expireDate): void {
public function createShare(IShare $share, string $shareWith, int $permissions, ?string $expireDate = null): void {
$share->setSharedWith($shareWith);
$share->setPermissions($permissions);

if ($expireDate !== '') {
if ($expireDate !== null && $expireDate !== '') {
try {
$expireDateTime = $this->parseDate($expireDate);
$share->setExpirationDate($expireDateTime);
Expand Down

0 comments on commit b96446f

Please sign in to comment.