Code Duplication    Length = 3-3 lines in 2 locations

code/Controller/AssetAdmin.php 2 locations

@@ 319-321 (lines=3) @@
316
317
        // CSRF check
318
        $token = SecurityToken::inst();
319
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
320
            return new HTTPResponse(null, 400);
321
        }
322
        $tmpFile = $data['Upload'];
323
        if (empty($data['ID']) || empty($tmpFile['name']) || !array_key_exists('Name', $data)) {
324
            return new HTTPResponse('Invalid request', 400);
@@ 225-227 (lines=3) @@
222
223
        // CSRF check
224
        $token = SecurityToken::inst();
225
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
226
            return new HTTPResponse(null, 400);
227
        }
228
229
        // Check parent record
230
        /** @var Folder $parentRecord */