src/Control/Middleware/TrustedProxyMiddleware.php
protected function isTrustedProxy(HTTPRequest $request)
    {
        $trustedIPs = $this->getTrustedProxyIPs();

        // Disabled
        if (empty($trustedIPs) || $trustedIPs === 'none') {
            return false;
        }

        // Allow all
        if ($trustedIPs === '*') {
            return true;
        }

        // Validate IP address
        $ip = $request->getIP();
        if ($ip) {
            return IPUtils::checkIP($ip, preg_split('/\s*,\s*/', $trustedIPs));
        }

        return false;
    }
protected function isTrustedProxy(HTTPRequest $request)
    {
        $trustedIPs = $this->getTrustedProxyIPs();

        // Disabled
        if (empty($trustedIPs) || $trustedIPs === 'none') {
            return false;
        }

        // Allow all
        if ($trustedIPs === '*') {
            return true;
        }

        // Validate IP address
        $ip = $request->getIP();
        if ($ip) {
            return IPUtils::checkIP($ip, preg_split('/\s*,\s*/', $trustedIPs));
        }

        return false;
    }
protected function isTrustedProxy ( HTTPRequest $ request ) { $ trustedIPs = $ this -> getTrustedProxyIPs ( ) ; // Disabled if ( empty ( $ trustedIPs ) || $ trustedIPs === 'none' ) { return false ; } // Allow all if ( $ trustedIPs === '*' ) { return true ; } // Validate IP address $ ip = $ request -> getIP ( ) ; if ( $ ip ) { return IPUtils :: checkIP ( $ ip , preg_split ( '/\s*,\s*/' , $ trustedIPs ) ) ; } return false ; }
Determine if the current request is coming from a trusted proxy

@param HTTPRequest $request
@return bool True if the request's source IP is a trusted proxy
Determine if the current request is coming from a trusted proxy