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:
parent
3de87776a9
commit
ee1bf57b54
@ -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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user