Fix to a trailing slash in the baseurl breaking the upgrade script

pull/834/merge v2.4.6
Iglocska 2016-01-07 16:38:23 +01:00
parent 62a20a2321
commit 24c2073f69
1 changed files with 5 additions and 0 deletions

View File

@ -85,6 +85,11 @@ class AppController extends Controller {
// Let us access $baseurl from all views
$baseurl = Configure::read('MISP.baseurl');
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->set('baseurl', h($baseurl));
// send users away that are using ancient versions of IE