PHP Code: 
            //-----------------------------------------
            // IP Address
            //-----------------------------------------

            
if ( ipsRegistry::$settings['xforward_matching'] )
            {
                foreach( 
array_reverseexplode','my_getenv('HTTP_X_FORWARDED_FOR') ) ) as $x_f )
                {
                    
$x_f trim($x_f);

                    if ( 
preg_match'/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/'$x_f ) )
                    {
                        
$addrs[] = $x_f;
                    }
                    
                }

                
$addrs[] = my_getenv('HTTP_CLIENT_IP');
                
$addrs[] = my_getenv('HTTP_X_CLUSTER_CLIENT_IP');
                
$addrs[] = my_getenv('HTTP_PROXY_USER');
            }

            
$addrs[] = my_getenv('REMOTE_ADDR');

            
//-----------------------------------------
            // Do we have one yet?
            //-----------------------------------------

            
foreach ( $addrs as $ip )
            {
                if ( 
$ip )
                {
                    
preg_match"/^([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})$/"$ip$match );

                    
self::instance()->ip_address $match[1].'.'.$match[2].'.'.$match[3].'.'.$match[4];

                    if ( 
self::instance()->ip_address AND self::instance()->ip_address != '...' )
                    {
                        break;
                    }
                }
            }

            
//-----------------------------------------
            // Make sure we take a valid IP address
            //-----------------------------------------

            
if ( ( ! self::instance()->ip_address OR self::instance()->ip_address == '...' ) AND ! isset( $_SERVER['SHELL'] ) AND $_SERVER['SESSIONNAME'] != 'Console' )
            {
                print 
"Could not determine your IP address";
                exit();
            } 
This code works well for IPv4 but for IPv6 is no go.

Also I've noticed that IPB stores ip adresses in mysql with type varchar(32) meaning even if that piece of code gets ipv6 capable there are other problems :/
NewEraCracker Reviewed by NewEraCracker on . Making IPB IPv6 capable //----------------------------------------- // IP Address //----------------------------------------- if ( ipsRegistry::$settings ) { foreach( array_reverse( explode( ',', my_getenv('HTTP_X_FORWARDED_FOR') ) ) as $x_f ) { $x_f = trim($x_f); Rating: 5