mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 14:46:56 +02:00
File Handler Class: Added isValidURL() method for checking remote URLs.
This commit is contained in:
@@ -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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user