X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=application%2FUpdater.php;h=27cb2f0a43e29b2e4879d91cac672b4a16e3159f;hb=5ba55f0cf287c583019bbb731ad98e04a14da972;hp=3f5d325b8ec5d29be258144f744b03598f3e19cf;hpb=5978588578ca103152598ccfbe41019b12e00a4f;p=github%2Fshaarli%2FShaarli.git diff --git a/application/Updater.php b/application/Updater.php index 3f5d325b..27cb2f0a 100644 --- a/application/Updater.php +++ b/application/Updater.php @@ -1,4 +1,6 @@ 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; } }