mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-04-08 17:15:08 +02:00
ErrorController: show valid title for exceptions
Multiline strings are not considered being a valid title. This patch strips all but the first line from the exception message when setting the title attribute.
This commit is contained in:
parent
33e326a232
commit
358b2582bc
@ -66,8 +66,9 @@ class ErrorController extends ActionController
|
||||
|
||||
break;
|
||||
default:
|
||||
$title = preg_replace('/\r?\n.*$/s', '', $exception->getMessage());
|
||||
$this->getResponse()->setHttpResponseCode(500);
|
||||
$this->view->title = 'Server error: ' . $exception->getMessage();
|
||||
$this->view->title = 'Server error: ' . $title;
|
||||
$this->view->message = $exception->getMessage();
|
||||
if ($this->getInvokeArg('displayExceptions') == true) {
|
||||
$this->view->stackTrace = $exception->getTraceAsString();
|
||||
|
Loading…
x
Reference in New Issue
Block a user