Code Duplication    Length = 3-3 lines in 3 locations

code/Controller/AssetAdmin.php 3 locations

@@ 266-268 (lines=3) @@
263
264
        // CSRF check
265
        $token = SecurityToken::inst();
266
        if (empty($vars[$token->getName()]) || !$token->check($vars[$token->getName()])) {
267
            return new SS_HTTPResponse(null, 400);
268
        }
269
270
        if (!isset($vars['ids']) || !$vars['ids']) {
271
            return (new SS_HTTPResponse(json_encode(['status' => 'error']), 400))
@@ 312-314 (lines=3) @@
309
310
        // CSRF check
311
        $token = SecurityToken::inst();
312
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
313
            return new SS_HTTPResponse(null, 400);
314
        }
315
316
        // check canAddChildren permissions
317
        if (!empty($data['ParentID']) && is_numeric($data['ParentID'])) {
@@ 374-376 (lines=3) @@
371
372
        // CSRF check
373
        $token = SecurityToken::inst();
374
        if (empty($data[$token->getName()]) || !$token->check($data[$token->getName()])) {
375
            return new SS_HTTPResponse(null, 400);
376
        }
377
378
        // check addchildren permissions
379
        if (!empty($data['ParentID']) && is_numeric($data['ParentID'])) {