roundcubemail/program/lib/Roundcube/rcube_utils.php
public static function check_referer()
    {
        $uri     = parse_url($_SERVER['REQUEST_URI']);
        $referer = parse_url(self::request_header('Referer'));

        return $referer['host'] == self::request_header('Host') && $referer['path'] == $uri['path'];
    }
public static function check_referer()
    {
        $uri     = parse_url($_SERVER['REQUEST_URI']);
        $referer = parse_url(self::request_header('Referer'));

        return $referer['host'] == self::request_header('Host') && $referer['path'] == $uri['path'];
    }
public static function check_referer ( ) { $ uri = parse_url ( $ _SERVER [ 'REQUEST_URI' ] ) ; $ referer = parse_url ( self :: request_header ( 'Referer' ) ) ; return $ referer [ 'host' ] == self :: request_header ( 'Host' ) && $ referer [ 'path' ] == $ uri [ 'path' ] ; }
Check whether the HTTP referer matches the current request

@return boolean True if referer is the same host+path, false if not
Check whether the HTTP referer matches the current request