Code Duplication    Length = 3-3 lines in 2 locations

core/UserAPI.php 2 locations

@@ 591-593 (lines=3) @@
588
    }
589
    
590
    public function locateUser() {
591
        if (CONFIG['GEOIP']['version'] != 1) {
592
            return ['status' => 'error', 'error' => 'Function for GEOIPv1 called, but config says this is not the version to use!'];
593
        }
594
        //$host = $_SERVER['REMOTE_ADDR'];
595
        $host = filter_input(INPUT_SERVER, 'REMOTE_ADDR', FILTER_VALIDATE_IP);
596
        $record = geoip_record_by_name($host);
@@ 612-614 (lines=3) @@
609
    }
610
611
    public function locateUser2() {
612
        if (CONFIG['GEOIP']['version'] != 2) {
613
            return ['status' => 'error', 'error' => 'Function for GEOIPv2 called, but config says this is not the version to use!'];
614
        }
615
        require_once CONFIG['GEOIP']['geoip2-path-to-autoloader'];
616
        $reader = new Reader(CONFIG['GEOIP']['geoip2-path-to-db']);
617
        $host = $_SERVER['REMOTE_ADDR'];