Attempt to get over https, then http

Supress warnings with @ on https attempt
Explode what we have afterwards
This commit is contained in:
Matt Pass
2014-04-26 16:54:11 +01:00
parent d5e6fb041f
commit 16c7e5d010

View File

@@ -10,9 +10,13 @@ if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*"
$updateMsg = '';
// Check for updates
if ($ICEcoder["checkUpdates"]) {
$icv_url = "http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
$icv_url = "https://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"];
if (ini_get('allow_url_fopen')) {
$icvInfo = explode("\n",file_get_contents($icv_url,false,$context));
$icvInfo = @file_get_contents($icv_url,false,$context);
if (!$icvInfo) {
$icvInfo = file_get_contents(str_replace("https:","http:",$icv_url), false, $context);
}
$icvInfo = explode("\n",$icvInfo);
} elseif (function_exists('curl_init')) {
$ch = curl_init($icv_url);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);