Browse Source
Merge pull request #34544 from nextcloud/fix/more-flexible-date-validation
More flexible date validation
pull/32226/head
Simon L
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
1 deletions
-
apps/files_sharing/lib/Controller/ShareAPIController.php
|
|
|
@ -1555,7 +1555,7 @@ class ShareAPIController extends OCSController { |
|
|
|
*/ |
|
|
|
private function parseDate(string $expireDate): \DateTime { |
|
|
|
try { |
|
|
|
$date = new \DateTime($expireDate); |
|
|
|
$date = new \DateTime(trim($expireDate, "\"")); |
|
|
|
} catch (\Exception $e) { |
|
|
|
throw new \Exception('Invalid date. Format must be YYYY-MM-DD'); |
|
|
|
} |
|
|
|
|