summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/legacy/updater.php2
-rw-r--r--lib/updater.php10
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/legacy/updater.php b/lib/legacy/updater.php
index 8a769a2f14b..eea7bb129cf 100644
--- a/lib/legacy/updater.php
+++ b/lib/legacy/updater.php
@@ -9,6 +9,6 @@
class OC_Updater {
public static function check() {
$updater = new \OC\Updater();
- return $updater->check();
+ return $updater->check('http://apps.owncloud.com/updater.php');
}
}
diff --git a/lib/updater.php b/lib/updater.php
index 6baf346a8e0..5a9f499f91b 100644
--- a/lib/updater.php
+++ b/lib/updater.php
@@ -37,9 +37,10 @@ class Updater extends BasicEmitter {
/**
* Check if a new version is available
+ * @param string $updateUrl the url to check, i.e. 'http://apps.owncloud.com/updater.php'
* @return array | bool
*/
- public function check() {
+ public function check($updaterUrl) {
// Look up the cache - it is invalidated all 30 minutes
if ((\OC_Appconfig::getValue('core', 'lastupdatedat') + 1800) > time()) {
@@ -51,17 +52,16 @@ class Updater extends BasicEmitter {
if (\OC_Appconfig::getValue('core', 'installedat', '') == '') {
\OC_Appconfig::setValue('core', 'installedat', microtime(true));
}
-
- $updaterurl = 'http://apps.owncloud.com/updater.php';
+;
$version = \OC_Util::getVersion();
$version['installed'] = \OC_Appconfig::getValue('core', 'installedat');
$version['updated'] = \OC_Appconfig::getValue('core', 'lastupdatedat');
$version['updatechannel'] = 'stable';
$version['edition'] = \OC_Util::getEditionString();
- $versionstring = implode('x', $version);
+ $versionString = implode('x', $version);
//fetch xml data from updater
- $url = $updaterurl . '?version=' . $versionstring;
+ $url = $updaterUrl . '?version=' . $versionString;
// set a sensible timeout of 10 sec to stay responsive even if the update server is down.
$ctx = stream_context_create(