Skip to content
Snippets Groups Projects
Verified Commit cd33b976 authored by Damien's avatar Damien
Browse files

FEAT #8879 TIME 0:15 Signature size control

parent efe391b3
No related branches found
No related tags found
No related merge requests found
......@@ -87,8 +87,11 @@ class SignatureController
$finfo = new \finfo(FILEINFO_MIME_TYPE);
$mimeType = $finfo->buffer($signature);
$type = explode('/', $mimeType);
$size = strlen($signature);
if ($type[0] != 'image') {
return $response->withStatus(400)->withJson(['errors' => 'Signature is not an image']);
} elseif ($size > 2000000) {
return $response->withStatus(400)->withJson(['errors' => 'Max file size reached (2 MB)']);
}
$storeInfos = DocserverController::storeResourceOnDocServer([
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment