aboutsummaryrefslogtreecommitdiffhomepage
path: root/application/Updater.php
diff options
context:
space:
mode:
authorArthurHoaro <arthur@hoa.ro>2016-05-30 20:15:36 +0200
committerArthurHoaro <arthur@hoa.ro>2016-06-11 09:30:56 +0200
commit7f179985b497053c59338667fe49c390aa626ab7 (patch)
tree3e759304a400b560b2ca0d49ac02ee8738b72839 /application/Updater.php
parentda10377b3c263d96a46cf9101c202554343d2cd0 (diff)
downloadShaarli-7f179985b497053c59338667fe49c390aa626ab7.tar.gz
Shaarli-7f179985b497053c59338667fe49c390aa626ab7.tar.zst
Shaarli-7f179985b497053c59338667fe49c390aa626ab7.zip
Remove remaining settings initialization in index.php
Except for those which require external data (timezone and $_SERVER).
Diffstat (limited to 'application/Updater.php')
-rw-r--r--application/Updater.php23
1 files changed, 23 insertions, 0 deletions
diff --git a/application/Updater.php b/application/Updater.php
index 31630ff5..db2144fe 100644
--- a/application/Updater.php
+++ b/application/Updater.php
@@ -191,6 +191,29 @@ class Updater
191 return false; 191 return false;
192 } 192 }
193 } 193 }
194
195 /**
196 * Escape settings which have been manually escaped in every request in previous versions:
197 * - general.title
198 * - general.header_link
199 * - extras.redirector
200 *
201 * @return bool true if the update is successful, false otherwise.
202 */
203 public function escapeUnescapedConfig()
204 {
205 $conf = ConfigManager::getInstance();
206 try {
207 $conf->set('general.title', escape($conf->get('general.title')));
208 $conf->set('general.header_link', escape($conf->get('general.header_link')));
209 $conf->set('extras.redirector', escape($conf->get('extras.redirector')));
210 $conf->write($this->isLoggedIn);
211 } catch (Exception $e) {
212 error_log($e->getMessage());
213 return false;
214 }
215 return true;
216 }
194} 217}
195 218
196/** 219/**