Firewall/HostRoleListener.php
private function isValid($pattern, $hostname)
    {
        return 0 === strpos($pattern, '/') && (1 + strrpos($pattern, '/')) === \strlen($pattern)
            ? (bool) preg_match($pattern, $hostname)
            : fnmatch($pattern, $hostname);
    }
private function isValid($pattern, $hostname)
    {
        return 0 === strpos($pattern, '/') && (1 + strrpos($pattern, '/')) === \strlen($pattern)
            ? (bool) preg_match($pattern, $hostname)
            : fnmatch($pattern, $hostname);
    }
private function isValid ( $ pattern , $ hostname ) { return 0 === strpos ( $ pattern , '/' ) && ( 1 + strrpos ( $ pattern , '/' ) ) === \ strlen ( $ pattern ) ? ( bool ) preg_match ( $ pattern , $ hostname ) : fnmatch ( $ pattern , $ hostname ) ; }
Check if the hostname matching with the host pattern.

@param string $pattern  The shell pattern or regex pattern starting and ending with a slash
@param string $hostname The host name

@return bool
Check if the hostname matching with the host pattern .