Merge pull request #2684 from JanSkalny/fix_baseurl_trailing_slash

fix: remove trailing slash from MISP.baseurl
pull/2754/head
Andras Iklody 2017-12-19 20:09:22 +01:00 committed by GitHub
commit 6e7a9da729
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -2613,6 +2613,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);
}