@@ 131-136 (lines=6) @@ | ||
128 | && !Filesystem::isFileBlacklisted($files['tmp_name'][0])) { |
|
129 | ||
130 | // TODO: ensure the size limit is decent for preview |
|
131 | if ($files['size'][0] > $this->maxSize) { |
|
132 | return new JSONResponse( |
|
133 | ['data' => ['message' => $this->l10n->t('File is too big')]], |
|
134 | Http::STATUS_BAD_REQUEST |
|
135 | ); |
|
136 | } |
|
137 | ||
138 | if (!$this->manager->isValidTemplateMime($files['type'][0])) { |
|
139 | return new JSONResponse( |
|
@@ 138-143 (lines=6) @@ | ||
135 | ); |
|
136 | } |
|
137 | ||
138 | if (!$this->manager->isValidTemplateMime($files['type'][0])) { |
|
139 | return new JSONResponse( |
|
140 | ['data' => ['message' => $this->l10n->t('Only template files can be uploaded')]], |
|
141 | Http::STATUS_BAD_REQUEST |
|
142 | ); |
|
143 | } |
|
144 | ||
145 | $templateName = $files['name'][0]; |
|
146 | $templateFile = file_get_contents($files['tmp_name'][0]); |