Skip to content

Commit

Permalink
fix(sharing): Don't change the type of the controller argument
Browse files Browse the repository at this point in the history
[EA] New value type (\DateTime) is not matching the resolved parameter type and might introduce types-related false-positives.

Signed-off-by: Joas Schilling <[email protected]>
  • Loading branch information
nickvergessen authored and nfebe committed Jun 10, 2024
1 parent c247700 commit b4f8bd3
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions apps/files_sharing/lib/Controller/ShareAPIController.php
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ public function createShare(
if ($expireDate !== null) {
if ($expireDate !== '') {
try {
$expireDate = $this->parseDate($expireDate);
$share->setExpirationDate($expireDate);
$expireDateTime = $this->parseDate($expireDate);
$share->setExpirationDate($expireDateTime);
} catch (\Exception $e) {
throw new OCSNotFoundException($this->l->t('Invalid date, date format must be YYYY-MM-DD'));
}
Expand Down Expand Up @@ -718,10 +718,6 @@ public function createShare(

$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
<<<<<<< HEAD

=======
>>>>>>> ec8a0a6267d (fix(shareApiController): avoid duplicated expiryDate operations)
$share->setSharedWithDisplayName($this->getCachedFederatedDisplayName($shareWith, false));
} elseif ($shareType === IShare::TYPE_REMOTE_GROUP) {
if (!$this->shareManager->outgoingServer2ServerGroupSharesAllowed()) {
Expand All @@ -734,10 +730,6 @@ public function createShare(

$share->setSharedWith($shareWith);
$share->setPermissions($permissions);
<<<<<<< HEAD

=======
>>>>>>> ec8a0a6267d (fix(shareApiController): avoid duplicated expiryDate operations)
} elseif ($shareType === IShare::TYPE_CIRCLE) {
if (!\OC::$server->getAppManager()->isEnabledForUser('circles') || !class_exists('\OCA\Circles\ShareByCircleProvider')) {
throw new OCSNotFoundException($this->l->t('You cannot share to a Circle if the app is not enabled'));
Expand Down

0 comments on commit b4f8bd3

Please sign in to comment.