Changed checkRemoteFile function to be faster and smaller

This requires that links be public. Forum links appear not to work in testing.
This commit is contained in:
Arctic Code 2013-05-11 19:56:18 -05:00
parent b3d1dfc202
commit 33712de612
1 changed files with 4 additions and 13 deletions

View File

@ -45,19 +45,10 @@ function prepOutputText($text) { // Takes mysql string and makes it able to be u
return $output;
}
function checkRemoteFile($url)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$url);
// don't download content
curl_setopt($ch, CURLOPT_NOBODY, 1);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
if(curl_exec($ch)!==FALSE){
return true;
}else{
return false;
}
function checkRemoteFile($url){
if (@file_get_contents($url)): return true;
else: return false;
endif;
}
if(isset($_GET['l'])) { // if there is a link...