Code Duplication    Length = 3-3 lines in 2 locations

core/UserAPI.php 2 locations

@@ 456-458 (lines=3) @@
453
    }
454
    
455
    private function locateUser1() {
456
        if (CONFIG['GEOIP']['version'] != 1) {
457
            return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!'];
458
        }
459
        //$host = $_SERVER['REMOTE_ADDR'];
460
        $host = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
461
        $record = geoip_record_by_name($host);
@@ 481-483 (lines=3) @@
478
     * @return array
479
     */
480
    private function locateUser2() {
481
        if (CONFIG['GEOIP']['version'] != 2) {
482
            return ['status' => 'error', 'error' => 'Function for GEOIPv2 called, but config says this is not the version to use!'];
483
        }
484
        require_once CONFIG['GEOIP']['geoip2-path-to-autoloader'];
485
        $reader = new Reader(CONFIG['GEOIP']['geoip2-path-to-db']);
486
        $host = $_SERVER['REMOTE_ADDR'];