From d6a82d1962cfb7461d706a7f99ccf3568e490d07 Mon Sep 17 00:00:00 2001 From: Matt Pass Date: Mon, 25 Feb 2013 16:39:46 +0000 Subject: [PATCH] Change of latest version URL, not JSON encoded Now calling /latest-version which is a tidier URL and also passing user version no to this This URL now tracks usage via Google Analytics, so I can begin to get an idea of which version nos users are on, geo data, overall usage etc No longer using json_encode as it's not JSON encoded, instead splitting on line breaks and grabbing first array value as the version no --- index.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.php b/index.php index cdea91a..5fd8b2b 100644 --- a/index.php +++ b/index.php @@ -8,7 +8,8 @@ if (!in_array($_SERVER["REMOTE_ADDR"], $_SESSION['allowedIPs']) && !in_array("*" $updateMsg = ''; // Check for updates if ($ICEcoder["checkUpdates"]) { - $icv = json_encode(file_get_contents("http://icecoder.net/latest-version.txt")); + $icv = explode("\n",file_get_contents("http://icecoder.net/latest-version?thisVersion=".$ICEcoder["versionNo"])); + $icv = $icv[0]; $icv = rtrim(ltrim($icv,'"'),'"\\n'); if ($ICEcoder["versionNo"]<$icv) { $updateMsg = ";top.ICEcoder.dataMessage('UPDATE INFO: ICEcoder v ".$icv." now available. (Your version is v ".$ICEcoder["versionNo"]."). Get it free from icecoder.net');";