Merge pull request #34544 from nextcloud/fix/more-flexible-date-validation

More flexible date validation
This commit is contained in:
Simon L 2022-10-13 01:10:55 +02:00 committed by GitHub
commit d967488ec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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');
}