code/libraries/joomlatools/library/dispatcher/request/abstract.php
public function isProxied()
    {
        if(!empty($this->_proxies) && $this->_headers->has('X-Forwarded-By'))
        {
            $ip      = $this->_headers->get('X-Forwarded-By');
            $proxies = $this->getProxies();

            //Validates the proxied IP-address against the list of trusted proxies.
            foreach ($proxies as $proxy)
            {
                if (strpos($proxy, '/') !== false)
                {
                    list($address, $netmask) = explode('/', $proxy, 2);

                    if ($netmask < 1 || $netmask > 32) {
                        return false;
                    }
                }
                else
                {
                    $address = $proxy;
                    $netmask = 32;
                }

                if(substr_compare(sprintf('%032b', ip2long($ip)), sprintf('%032b', ip2long($address)), 0, $netmask) === 0) {
                    return true;
                }
            }
        }

        return false;
    }
public function isProxied()
    {
        if(!empty($this->_proxies) && $this->_headers->has('X-Forwarded-By'))
        {
            $ip      = $this->_headers->get('X-Forwarded-By');
            $proxies = $this->getProxies();

            //Validates the proxied IP-address against the list of trusted proxies.
            foreach ($proxies as $proxy)
            {
                if (strpos($proxy, '/') !== false)
                {
                    list($address, $netmask) = explode('/', $proxy, 2);

                    if ($netmask < 1 || $netmask > 32) {
                        return false;
                    }
                }
                else
                {
                    $address = $proxy;
                    $netmask = 32;
                }

                if(substr_compare(sprintf('%032b', ip2long($ip)), sprintf('%032b', ip2long($address)), 0, $netmask) === 0) {
                    return true;
                }
            }
        }

        return false;
    }
public function isProxied ( ) { if ( ! empty ( $ this -> _proxies ) && $ this -> _headers -> has ( 'X-Forwarded-By' ) ) { $ ip = $ this -> _headers -> get ( 'X-Forwarded-By' ) ; $ proxies = $ this -> getProxies ( ) ; //Validates the proxied IP-address against the list of trusted proxies. foreach ( $ proxies as $ proxy ) { if ( strpos ( $ proxy , '/' ) !== false ) { list ( $ address , $ netmask ) = explode ( '/' , $ proxy , 2 ) ; if ( $ netmask < 1 || $ netmask > 32 ) { return false ; } } else { $ address = $ proxy ; $ netmask = 32 ; } if ( substr_compare ( sprintf ( '%032b' , ip2long ( $ ip ) ) , sprintf ( '%032b' , ip2long ( $ address ) ) , 0 , $ netmask ) === 0 ) { return true ; } } } return false ; }
Checks whether the request is proxied or not.

This method reads the proxy IP from the "X-Forwarded-By" header. The "X-Forwarded-By" header must contain the
proxy IP address and, potentially, a port number). If no "X-Forwarded-By" header can be found, or the header
IP address doesn't match the list of trusted proxies the function will return false.

@link http://tools.ietf.org/html/draft-ietf-appsawg-http-forwarded-10#page-7

@return  boolean Returns TRUE if the request is proxied and the proxy is trusted. FALSE otherwise.
Checks whether the request is proxied or not .