Léarch 2019-05-17 11:24:02 +00:00 committed by Vito Piserchia
parent 8e9cbbd5fb
commit 8207be22ba
5 changed files with 13 additions and 10 deletions

View File

@ -111,9 +111,12 @@ if (!$relativePaths) {
* Configure base URL for CakePHP
*/
if (Configure::read('MISP.baseurl')) {
$regex = "%^(?<proto>https?)://(?<host>(?:(?:\w|-)+\.)+[a-z]{2,5})(?::(?<port>[0-9]+))?(?<base>/[a-z0-9_\-\.]+)?$%i";
$regex = "%^(?<fullBaseUrl>(?<proto>https?)://(?<host>(?:(?:\w|-)+\.)+[a-z]{2,5})(?::(?<port>[0-9]+))?)(?<base>/[a-z0-9_\-\.]+)?$%i";
if (preg_match($regex, Configure::read('MISP.baseurl'), $matches)) {
if (isset($matches['base'])) Configure::write('App.base', $matches['base']);
if (isset($matches['base'])) {
Configure::write('App.base', $matches['base']);
Configure::write('App.fullBaseUrl', $matches['fullBaseUrl']);
}
}
}

View File

@ -257,7 +257,7 @@ class AppController extends Controller
'email' => $user['User']['email'],
'action' => 'auth',
'title' => 'Successful authentication using API key',
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . $this->here,
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . Router::url(null, true),
);
$this->Log->save($log);
}
@ -369,7 +369,7 @@ class AppController extends Controller
}
if ($this->params['controller'] !== 'users' || !in_array($this->params['action'], $pre_auth_actions)) {
if (!$this->request->is('ajax')) {
$this->Session->write('pre_login_requested_url', $this->here);
$this->Session->write('pre_login_requested_url', Router::url(null, true));
}
$this->_redirectToLogin();
}
@ -1105,7 +1105,7 @@ class AppController extends Controller
'email' => $user['User']['email'],
'action' => 'auth',
'title' => 'Successful authentication using ' . $authName . ' key',
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . $this->here,
'change' => 'HTTP method: ' . $_SERVER['REQUEST_METHOD'] . PHP_EOL . 'Target: ' . Router::url(null, true),
);
$this->Log->save($log);
}

View File

@ -809,7 +809,7 @@ class FeedsController extends AppController
$result = $this->__toggleEnable($id, true);
$this->set('name', $result['message']);
$this->set('message', $result['message']);
$this->set('url', $this->here);
$this->set('url', Router::url(null, true));
if ($result) {
$this->set('_serialize', array('name', 'message', 'url'));
} else {
@ -823,7 +823,7 @@ class FeedsController extends AppController
$result = $this->__toggleEnable($id, false);
$this->set('name', $result['message']);
$this->set('message', $result['message']);
$this->set('url', $this->here);
$this->set('url', Router::url(null, true));
if ($result['result']) {
$this->set('_serialize', array('name', 'message', 'url'));
} else {

View File

@ -1,5 +1,5 @@
<?php
$urlHere = $this->here;
$urlHere = Router::url(null, true);
$urlHere = explode('/', $urlHere);
foreach ($urlHere as $k => $v) {
$urlHere[$k] = urlencode($v);

View File

@ -441,7 +441,7 @@
?>
<span>
<?php echo __('This event has ');?><span class="bold"><?php echo h($event['Event']['FeedCount']); ?></span>
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h($this->here));?>
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h(Router::url(null, true)));?>
</span>
<?php
endif;
@ -476,7 +476,7 @@
?>
<span>
<?php echo __('This event has ');?><span class="bold"><?php echo h($event['Event']['FeedCount']); ?></span>
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h($this->here));?>
<?php echo __('correlations with data contained within the various feeds, however, due to the large number of attributes the actual feed correlations are not shown. Click <a href="%s\/overrideLimit:1">here</a> to refresh the page with the feed data loaded.', h(Router::url(null, true)));?>
</span>
<?php
endif;