public static function checkIP($UserIP = false)
    {
        // Check if IP present
        if ($UserIP === false)
        {
            if (\Environment::get('ip'))
            {
                if (strpos(\Environment::get('ip'), ',') !== false) //first IP
                {
                    $UserIP =  trim(substr(\Environment::get('ip'), 0, strpos(\Environment::get('ip'), ',')));
                }
                else
                {
                    $UserIP = trim(\Environment::get('ip'));
                }
            }
            else
            {
                return false; // No IP, no search.
            }
            //Test for private IPs
            if ( true === static::checkPrivateIP($UserIP) &&
                false === empty($_SERVER['HTTP_X_FORWARDED_FOR'])
            )
            {
                //second try
                $HTTPXFF = $_SERVER['HTTP_X_FORWARDED_FOR'];
                $_SERVER['HTTP_X_FORWARDED_FOR'] = '';
            
                $UserIP = \Environment::get('ip');
                if (strpos($UserIP, ',') !== false) //first IP
                {
                    $UserIP = trim( substr($UserIP, 0, strpos($UserIP, ',') ) );
                }
                $_SERVER['HTTP_X_FORWARDED_FOR'] = $HTTPXFF;
            }
        }
        // IPv4 or IPv6 ?
        switch (static::getIpVersion($UserIP))
        {
        	case "IPv4":
        	    if ( static::checkBotIPv4($UserIP, static::getBotIpv4List()) === true) { return true; }
        	    break;
        	case "IPv6":
        	    if ( static::checkBotIPv6($UserIP, static::getBotIpv6List()) === true) { return true; }
        	    break;
        	default:
        	    return false;
        	    break;
        }
        return false;
    }
public static function checkIP($UserIP = false)
    {
        // Check if IP present
        if ($UserIP === false)
        {
            if (\Environment::get('ip'))
            {
                if (strpos(\Environment::get('ip'), ',') !== false) //first IP
                {
                    $UserIP =  trim(substr(\Environment::get('ip'), 0, strpos(\Environment::get('ip'), ',')));
                }
                else
                {
                    $UserIP = trim(\Environment::get('ip'));
                }
            }
            else
            {
                return false; // No IP, no search.
            }
            //Test for private IPs
            if ( true === static::checkPrivateIP($UserIP) &&
                false === empty($_SERVER['HTTP_X_FORWARDED_FOR'])
            )
            {
                //second try
                $HTTPXFF = $_SERVER['HTTP_X_FORWARDED_FOR'];
                $_SERVER['HTTP_X_FORWARDED_FOR'] = '';
            
                $UserIP = \Environment::get('ip');
                if (strpos($UserIP, ',') !== false) //first IP
                {
                    $UserIP = trim( substr($UserIP, 0, strpos($UserIP, ',') ) );
                }
                $_SERVER['HTTP_X_FORWARDED_FOR'] = $HTTPXFF;
            }
        }
        // IPv4 or IPv6 ?
        switch (static::getIpVersion($UserIP))
        {
        	case "IPv4":
        	    if ( static::checkBotIPv4($UserIP, static::getBotIpv4List()) === true) { return true; }
        	    break;
        	case "IPv6":
        	    if ( static::checkBotIPv6($UserIP, static::getBotIpv6List()) === true) { return true; }
        	    break;
        	default:
        	    return false;
        	    break;
        }
        return false;
    }
public static function checkIP ( $ UserIP = false ) { // Check if IP present if ( $ UserIP === false ) { if ( \ Environment :: get ( 'ip' ) ) { if ( strpos ( \ Environment :: get ( 'ip' ) , ',' ) !== false ) //first IP { $ UserIP = trim ( substr ( \ Environment :: get ( 'ip' ) , 0 , strpos ( \ Environment :: get ( 'ip' ) , ',' ) ) ) ; } else { $ UserIP = trim ( \ Environment :: get ( 'ip' ) ) ; } } else { return false ; // No IP, no search. } //Test for private IPs if ( true === static :: checkPrivateIP ( $ UserIP ) && false === empty ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) ) { //second try $ HTTPXFF = $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ; $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] = '' ; $ UserIP = \ Environment :: get ( 'ip' ) ; if ( strpos ( $ UserIP , ',' ) !== false ) //first IP { $ UserIP = trim ( substr ( $ UserIP , 0 , strpos ( $ UserIP , ',' ) ) ) ; } $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] = $ HTTPXFF ; } } // IPv4 or IPv6 ? switch ( static :: getIpVersion ( $ UserIP ) ) { case "IPv4" : if ( static :: checkBotIPv4 ( $ UserIP , static :: getBotIpv4List ( ) ) === true ) { return true ; } break ; case "IPv6" : if ( static :: checkBotIPv6 ( $ UserIP , static :: getBotIpv6List ( ) ) === true ) { return true ; } break ; default : return false ; break ; } return false ; }
Spider Bot IP Check
Detect the IP version and calls the method checkBotIPv4 respectively checkBotIPv6.

@param string   User IP, optional for tests
@return boolean true when bot found over IP
@access public
Spider Bot IP Check Detect the IP version and calls the method checkBotIPv4 respectively checkBotIPv6 .