/**
* Returns true if the host of both specified requests match.
*
* @param Request $first First request to match.
* @param Request $second Second request to match.
*
* @return boolean True if the host of both specified requests match.
*/
public static function matchHost(Request $first, Request $second)
{
if (null !== $first->getHost() && !preg_match('#' . str_replace('#', '\\#', $first->getHost()) . '#i', $second->getHost())) {
return false;
}
return true;
}