protected function _validUrl($url)
{
$headers = Utility::getHeaderFromUrl($url);
if ($headers === false) {
return false;
}
$headers = implode("\n", $headers);
$protocol = mb_strpos($url, 'https://') === 0 ? 'HTTP' : 'HTTP';
if (!preg_match('#^' . $protocol . '/.*?\\s+[(200|301|302)]+\\s#i', $headers)) {
return false;
}
if (preg_match('#^' . $protocol . '/.*?\\s+[(404|999)]+\\s#i', $headers)) {
return false;
}
return true;
}