Code Duplication    Length = 12-12 lines in 3 locations

api/v1/class.UsersAPI.php 3 locations

@@ 399-410 (lines=12) @@
396
        {
397
            $email = $params['email'];
398
        }
399
        if($email === false)
400
        {
401
            $params = $request->getParsedBody();
402
            if(isset($params['email']))
403
            {
404
                $email = $params['email'];
405
            }
406
            if($email === false)
407
            {
408
                return $response->withStatus(400);
409
            }
410
        }
411
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false || strpos($email, '@') === false)
412
        {
413
            return $response->withJson(false);
@@ 441-452 (lines=12) @@
438
        {
439
            $uid = $params['uid'];
440
        }
441
        if($uid === false)
442
        {
443
            $params = $request->getParsedBody();
444
            if(isset($params['uid']))
445
            {
446
                $uid = $params['uid'];
447
            }
448
            if($uid === false)
449
            {
450
                return $response->withStatus(400);
451
            }
452
        }
453
        if(strpos($uid, '=') !== false || strpos($uid, ',') !== false)
454
        {
455
            return $response->withJson(false);
@@ 501-512 (lines=12) @@
498
        {
499
            $email = $params['email'];
500
        }
501
        if($email === false)
502
        {
503
            $params = $request->getParsedBody();
504
            if(isset($params['email']))
505
            {
506
                $email = $params['email'];
507
            }
508
            if($email === false)
509
            {
510
                return $response->withStatus(400);
511
            }
512
        }
513
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false)
514
        {
515
            return $response->withStatus(400);