DirectController: Verify that expirationTime is between 0s and 24h
Signed-off-by: Iscle <albertiscle9@gmail.com>
This commit is contained in:
parent
ebd734dc86
commit
0e5d692866
|
@ -90,6 +90,10 @@ class DirectController extends OCSController {
|
|||
throw new OCSNotFoundException();
|
||||
}
|
||||
|
||||
if ($expirationTime <= 0 || $expirationTime > (60 * 60 * 24)) {
|
||||
throw new OCSBadRequestException('Expiration time should be greater than 0 and less than or equal to ' . (60 * 60 * 24));
|
||||
}
|
||||
|
||||
$file = array_shift($files);
|
||||
if (!($file instanceof File)) {
|
||||
throw new OCSBadRequestException('Direct download only works for files');
|
||||
|
|
Loading…
Reference in New Issue