Skip to content
Snippets Groups Projects
Commit 68dd3686 authored by Peter Rotich's avatar Peter Rotich
Browse files

Make backtrace logs well formated and preserve white spaces on display.

parent be363a2e
No related branches found
No related tags found
No related merge requests found
......@@ -21,7 +21,9 @@ class ContentAjaxAPI extends AjaxController {
function log($id) {
if($id && ($log=Log::lookup($id))) {
$content=sprintf('<div style="width:500px;">&nbsp;<strong>%s</strong><br><p>%s</p>
$content=sprintf('<div
style="width:500px;">&nbsp;<strong>%s</strong><br><p
style="white-space:pre-line;">%s</p>
<hr><strong>Log Date:</strong> <em>%s</em> <strong>IP Address:</strong> <em>%s</em></div>',
$log->getTitle(),
Format::display(str_replace(',',', ',$log->getText())),
......
......@@ -271,7 +271,7 @@ class osTicket {
$e = new Exception();
$bt = str_replace(ROOT_DIR, '(root)/', $e->getTraceAsString());
$error .= "\n\n---- Backtrace ----\n".$bt;
$error .= nl2br("\n\n---- Backtrace ----\n".$bt);
return $this->log(LOG_ERR, $title, $error, $alert);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment