1
0
mirror of https://github.com/e107inc/e107.git synced 2025-05-04 11:24:54 +02:00

File Handler Class: Added isValidURL() method for checking remote URLs.

This commit is contained in:
Cameron 2016-04-04 12:18:48 -07:00
parent 3de87776a9
commit ee1bf57b54

View File

@ -1182,6 +1182,17 @@ class e_file
}
/**
* Returns true is the URL is valid and false if it is not.
* @param $url
* @return bool
*/
public function isValidURL($url)
{
$headers = get_headers($url);
// print_a($headers);
return (stripos($headers[0],"200 OK") || stripos($headers[0],"302")) ? true : false;
}
/**