diff --git a/include/class.thread.php b/include/class.thread.php index 6b0df71d49afd394aa5fdbbd3c17c2be50b6e59e..8564e249ab7cb6bbbe934b084c949f6de3d46e9e 100644 --- a/include/class.thread.php +++ b/include/class.thread.php @@ -1415,15 +1415,18 @@ class TextThreadBody extends ThreadBody { if ($this->isEmpty()) return '(empty)'; + $escaped = Format::htmlchars($this->body); switch ($output) { case 'html': + return '<div style="white-space:pre-wrap">' + .Format::clickableurls($escaped).'</div>'; case 'email': return '<div style="white-space:pre-wrap">' - .Format::htmlchars($this->body).'</div>'; + .$escaped.'</div>'; case 'pdf': - return nl2br($this->body); + return nl2br($escaped); default: - return '<pre>'.$this->body.'</pre>'; + return '<pre>'.$escaped.'</pre>'; } } } diff --git a/include/staff/ticket-view.inc.php b/include/staff/ticket-view.inc.php index d19e5e5a9d34eb9679b37003e0e3c99da6d5dcda..e3e93f736b8bf815dcf4567902876550360d01a8 100644 --- a/include/staff/ticket-view.inc.php +++ b/include/staff/ticket-view.inc.php @@ -406,7 +406,7 @@ $tcount+= $ticket->getNumNotes(); </tr> <tr><td colspan="4" class="thread-body" id="thread-id-<?php echo $entry['id']; ?>"><div><?php - echo Format::clickableurls($entry['body']->toHtml()); ?></div></td></tr> + echo $entry['body']->toHtml(); ?></div></td></tr> <?php if($entry['attachments'] && ($tentry = $ticket->getThreadEntry($entry['id']))