fix: remove trailing slash from MISP.baseurl

pull/2684/head
Jan Skalny 2017-11-23 01:10:19 +01:00
parent 7dbe813e89
commit 6933050e2e
2 changed files with 2 additions and 1 deletions

View File

@ -145,7 +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, '/');
Configure::write('MISP.baseurl', $baseurl);
$this->Server->serverSettingsSaveValue('MISP.baseurl', $baseurl);
}
$this->set('baseurl', h($baseurl));

View File

@ -2592,6 +2592,7 @@ class Server extends AppModel {
}
$settingsString = var_export($settingsArray, true);
$settingsString = '<?php' . "\n" . '$config = ' . $settingsString . ';';
opcache_reset();
file_put_contents(APP . 'Config' . DS . 'config.php', $settingsString);
}