Code Duplication    Length = 12-12 lines in 3 locations

api/v1/class.UsersAPI.php 3 locations

@@ 398-409 (lines=12) @@
395
        {
396
            $email = $params['email'];
397
        }
398
        if($email === false)
399
        {
400
            $params = $request->getParsedBody();
401
            if(isset($params['email']))
402
            {
403
                $email = $params['email'];
404
            }
405
            if($email === false)
406
            {
407
                return $response->withStatus(400);
408
            }
409
        }
410
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false || strpos($email, '@') === false)
411
        {
412
            return $response->withJson(false);
@@ 440-451 (lines=12) @@
437
        {
438
            $uid = $params['uid'];
439
        }
440
        if($uid === false)
441
        {
442
            $params = $request->getParsedBody();
443
            if(isset($params['uid']))
444
            {
445
                $uid = $params['uid'];
446
            }
447
            if($uid === false)
448
            {
449
                return $response->withStatus(400);
450
            }
451
        }
452
        if(strpos($uid, '=') !== false || strpos($uid, ',') !== false)
453
        {
454
            return $response->withJson(false);
@@ 547-558 (lines=12) @@
544
        {
545
            $email = $params['email'];
546
        }
547
        if($email === false)
548
        {
549
            $params = $request->getParsedBody();
550
            if(isset($params['email']))
551
            {
552
                $email = $params['email'];
553
            }
554
            if($email === false)
555
            {
556
                return $response->withStatus(400);
557
            }
558
        }
559
        if(filter_var($email, FILTER_VALIDATE_EMAIL) === false)
560
        {
561
            return $response->withStatus(400);