X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUpdater.php;h=fd7e2073089eaca16a51fee881a1a68b45cc05df;hb=c904bccce1c49eb130875ad055556fa6f9f36096;hp=90aba74508faa33472d3bc6a754f127cf1a8e066;hpb=65e56cbe49a7eb2a0cb09dda85daab3b921472ee;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Updater.php b/application/Updater.php index 90aba745..fd7e2073 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -1,4 +1,7 @@ conf->get('resource.theme') !== 'default') { + return true; + } + $this->conf->set('resource.theme', 'vintage'); + $this->conf->write($this->isLoggedIn); + + return true; + } + + /** + * * `markdown_escape` is a new setting, set to true as default. + * + * If the markdown plugin was already enabled, escaping is disabled to avoid + * breaking existing entries. + */ + public function updateMethodEscapeMarkdown() + { + if ($this->conf->exists('security.markdown_escape')) { + return true; + } + + if (in_array('markdown', $this->conf->get('general.enabled_plugins'))) { + $this->conf->set('security.markdown_escape', false); + } else { + $this->conf->set('security.markdown_escape', true); + } + $this->conf->write($this->isLoggedIn); + + return true; + } + + /** + * Add 'http://' to Piwik URL the setting is set. + * + * @return bool true if the update is successful, false otherwise. + */ + public function updateMethodPiwikUrl() + { + if (! $this->conf->exists('plugins.PIWIK_URL') || startsWith($this->conf->get('plugins.PIWIK_URL'), 'http')) { + return true; + } + + $this->conf->set('plugins.PIWIK_URL', 'http://'. $this->conf->get('plugins.PIWIK_URL')); + $this->conf->write($this->isLoggedIn); + return true; + } } /**