]> source.dussan.org Git - nextcloud-server.git/commitdiff
Fix invalid check after constructing DateTime 26005/head
authorRoeland Jago Douma <roeland@famdouma.nl>
Mon, 8 Mar 2021 15:32:34 +0000 (16:32 +0100)
committerRoeland Jago Douma <roeland@famdouma.nl>
Mon, 8 Mar 2021 15:32:34 +0000 (16:32 +0100)
We construct an object. Either that works on not.But the result can't be
false.

Found by psalm

Signed-off-by: Roeland Jago Douma <roeland@famdouma.nl>
apps/files_sharing/lib/Controller/ShareAPIController.php

index 12408d8e108fa418420f381c95e3ccdab6012f48..0a1ad84f81612c9b75b85b80e74046d49b9b26e8 100644 (file)
@@ -1455,10 +1455,6 @@ class ShareAPIController extends OCSController {
                        throw new \Exception('Invalid date. Format must be YYYY-MM-DD');
                }
 
-               if ($date === false) {
-                       throw new \Exception('Invalid date. Format must be YYYY-MM-DD');
-               }
-
                $date->setTime(0, 0, 0);
 
                return $date;