fixes bug where Server model might not yet be loaded

pull/2754/head
Christophe Vandeplas 2017-12-20 11:21:46 +01:00
parent ccb3118940
commit 64116c54d7
1 changed files with 1 additions and 0 deletions

View File

@ -145,6 +145,7 @@ class AppController extends Controller {
if (substr($baseurl, -1) == '/') {
// if the baseurl has a trailing slash, remove it. It can lead to issues with the CSRF protection
$baseurl = rtrim($baseurl, '/');
$this->loadModel('Server');
$this->Server->serverSettingsSaveValue('MISP.baseurl', $baseurl);
}
$this->set('baseurl', h($baseurl));