Code Duplication    Length = 3-3 lines in 2 locations

core/UserAPI.php 2 locations

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