fix: [UI] Nicer error message for CSRF

pull/6735/head
Jakub Onderka 2020-12-10 20:38:02 +01:00
parent 976591972a
commit 255330e5a2
2 changed files with 9 additions and 17 deletions

View File

@ -1,33 +1,19 @@
<div class="misp-error-container">
<?php
/**
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Errors
* @since CakePHP(tm) v 0.10.0.1076
* @license http://www.opensource.org/licenses/mit-license.php MIT License
*/
if ($message !== 'csrf'):
if ($message !== 'The request has been black-holed'):
?>
<h2><?php echo $message; ?></h2>
<p class="error">
<strong><?php echo __d('cake', 'Error'); ?>: </strong>
<?php printf(
__d('cake', 'The requested address %s was not found on this server.'),
"<strong>'{$url}'</strong>"
"<strong>'$url'</strong>"
); ?>
</p>
<?php
if (Configure::read('debug') > 0):
echo $this->element('exception_stack_trace');
endif;
else:
?>
<h2><?php echo __('You have tripped the cross-site request forgery protection of MISP');?></h2>
@ -43,3 +29,5 @@ else:
echo $this->element('exception_stack_trace');
endif;
endif;
?>
</div>

View File

@ -2683,3 +2683,7 @@ a.orgImg {
padding-top: 3px;
padding-bottom: 2px;
}
.misp-error-container {
margin: 0 20px;
}