Code Duplication    Length = 12-12 lines in 3 locations

api/v1/class.UsersAPI.php 3 locations

@@ 390-401 (lines=12) @@
387
        {
388
            $email = $params['email'];
389
        }
390
        if($email === false)
391
        {
392
            $params = $request->getParsedBody();
393
            if(isset($params['email']))
394
            {
395
                $email = $params['email'];
396
            }
397
            if($email === false)
398
            {
399
                return $response->withStatus(400);
400
            }
401
        }
402
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false || strpos($email, '@') === false)
403
        {
404
            return $response->withJson(false);
@@ 432-443 (lines=12) @@
429
        {
430
            $uid = $params['uid'];
431
        }
432
        if($uid === false)
433
        {
434
            $params = $request->getParsedBody();
435
            if(isset($params['uid']))
436
            {
437
                $uid = $params['uid'];
438
            }
439
            if($uid === false)
440
            {
441
                return $response->withStatus(400);
442
            }
443
        }
444
        if(strpos($uid, '=') !== false || strpos($uid, ',') !== false)
445
        {
446
            return $response->withJson(false);
@@ 492-503 (lines=12) @@
489
        {
490
            $email = $params['email'];
491
        }
492
        if($email === false)
493
        {
494
            $params = $request->getParsedBody();
495
            if(isset($params['email']))
496
            {
497
                $email = $params['email'];
498
            }
499
            if($email === false)
500
            {
501
                return $response->withStatus(400);
502
            }
503
        }
504
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false)
505
        {
506
            return $response->withStatus(400);