Code Duplication    Length = 3-3 lines in 2 locations

code/Controller/AssetAdmin.php 2 locations

@@ 187-189 (lines=3) @@
184
185
        // CSRF check
186
        $token = SecurityToken::inst();
187
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
188
            return new HTTPResponse(null, 400);
189
        }
190
191
        // Check parent record
192
        /** @var Folder $parentRecord */
@@ 276-278 (lines=3) @@
273
274
        // CSRF check
275
        $token = SecurityToken::inst();
276
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
277
            return new HTTPResponse(null, 400);
278
        }
279
        $tmpFile = $data['Upload'];
280
        if (empty($data['ID']) || empty($tmpFile['name']) || !array_key_exists('Name', $data)) {
281
            return new HTTPResponse('Invalid request', 400);