Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Napoli <matthieu@mnapoli.fr>2015-03-02 07:28:20 +0300
committerMatthieu Napoli <matthieu@mnapoli.fr>2015-03-04 06:58:59 +0300
commit1202d1a4f476e8d8abb7e62f5c282d249f5df10b (patch)
tree84ee73675e9cf587e853059ad2ac2fbb76fa027d /plugins/CoreUpdater/Controller.php
parenta24a01eef84a6b110f020a634f479f2c0e76c986 (diff)
Update Piwik using HTTPS + add a system check
- Piwik will update over HTTPS if curl is supported - the system check verifies that updating over HTTPS is supported (= curl supported)
Diffstat (limited to 'plugins/CoreUpdater/Controller.php')
-rw-r--r--plugins/CoreUpdater/Controller.php11
1 files changed, 10 insertions, 1 deletions
diff --git a/plugins/CoreUpdater/Controller.php b/plugins/CoreUpdater/Controller.php
index 90b0d13aa5..ca72b62ac0 100644
--- a/plugins/CoreUpdater/Controller.php
+++ b/plugins/CoreUpdater/Controller.php
@@ -48,7 +48,8 @@ class Controller extends \Piwik\Plugin\Controller
protected static function getLatestZipUrl($newVersion)
{
if (@Config::getInstance()->Debug['allow_upgrades_to_beta']) {
- return 'http://builds.piwik.org/piwik-' . $newVersion . '.zip';
+ $url = Config::getInstance()->General['latest_beta_version_url'];
+ return sprintf($url, $newVersion);
}
return Config::getInstance()->General['latest_version_url'];
}
@@ -426,4 +427,12 @@ class Controller extends \Piwik\Plugin\Controller
return PluginManager::getInstance()->getIncompatiblePlugins($piwikVersion);
}
+ public static function isUpdatingOverHttps()
+ {
+ if (strpos(self::getLatestZipUrl(''), 'https') === false) {
+ return false;
+ }
+
+ return Http::getTransportMethod() === 'curl';
+ }
}