diff options
author | ArthurHoaro <arthur@hoa.ro> | 2017-03-09 20:51:28 +0100 |
---|---|---|
committer | ArthurHoaro <arthur@hoa.ro> | 2017-03-11 13:27:02 +0100 |
commit | fe83d45c465bad94709ce5aacf7acad47ad75077 (patch) | |
tree | c9b1bcc7c6461f8d1846f376d2b94adadceed6e4 /application/Updater.php | |
parent | 844021ab4c0d3dd6c26704648a736fa53244c914 (diff) | |
download | Shaarli-fe83d45c465bad94709ce5aacf7acad47ad75077.tar.gz Shaarli-fe83d45c465bad94709ce5aacf7acad47ad75077.tar.zst Shaarli-fe83d45c465bad94709ce5aacf7acad47ad75077.zip |
Fix #773: set Piwik URL protocol
Diffstat (limited to 'application/Updater.php')
-rw-r--r-- | application/Updater.php | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/application/Updater.php b/application/Updater.php index 27cb2f0a..fd7e2073 100644 --- a/application/Updater.php +++ b/application/Updater.php | |||
@@ -1,6 +1,7 @@ | |||
1 | <?php | 1 | <?php |
2 | use Shaarli\Config\ConfigJson; | 2 | use Shaarli\Config\ConfigJson; |
3 | use Shaarli\Config\ConfigPhp; | 3 | use Shaarli\Config\ConfigPhp; |
4 | use Shaarli\Config\ConfigManager; | ||
4 | 5 | ||
5 | /** | 6 | /** |
6 | * Class Updater. | 7 | * Class Updater. |
@@ -363,6 +364,22 @@ class Updater | |||
363 | 364 | ||
364 | return true; | 365 | return true; |
365 | } | 366 | } |
367 | |||
368 | /** | ||
369 | * Add 'http://' to Piwik URL the setting is set. | ||
370 | * | ||
371 | * @return bool true if the update is successful, false otherwise. | ||
372 | */ | ||
373 | public function updateMethodPiwikUrl() | ||
374 | { | ||
375 | if (! $this->conf->exists('plugins.PIWIK_URL') || startsWith($this->conf->get('plugins.PIWIK_URL'), 'http')) { | ||
376 | return true; | ||
377 | } | ||
378 | |||
379 | $this->conf->set('plugins.PIWIK_URL', 'http://'. $this->conf->get('plugins.PIWIK_URL')); | ||
380 | $this->conf->write($this->isLoggedIn); | ||
381 | return true; | ||
382 | } | ||
366 | } | 383 | } |
367 | 384 | ||
368 | /** | 385 | /** |