src/Model/Table/Table.php
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;
	}
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;
	}
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 ; }
Checks if a url is valid

@param string $url
@return bool Success
Checks if a url is valid