monitoring: Use nl2br instead of str_replace for downtime comment and comment text
This commit is contained in:
parent
f47dae1092
commit
d07e1329e8
|
@ -34,7 +34,7 @@
|
|||
|
||||
foreach ($object->comments as $comment) {
|
||||
// Ticket hook sample
|
||||
$text = $this->tickets ? preg_replace_callback(
|
||||
$commentText = $this->tickets ? preg_replace_callback(
|
||||
$this->tickets->getPattern(),
|
||||
array($this->tickets, 'createLink'),
|
||||
$this->escape($comment->comment)
|
||||
|
@ -56,11 +56,11 @@ foreach ($object->comments as $comment) {
|
|||
(<?= ucfirst($comment->type) ?>):
|
||||
</td>
|
||||
<td style="padding-left: .5em;">
|
||||
<?= str_replace(array('\r\n', '\n'), '<br>', $text) ?>
|
||||
<?= nl2br($commentText) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } // endforeach ?>
|
||||
<?php } // endforeach ?>
|
||||
|
|
|
@ -34,7 +34,7 @@
|
|||
|
||||
foreach ($object->downtimes as $downtime) {
|
||||
// Ticket hook sample
|
||||
$text = $this->tickets ? preg_replace_callback(
|
||||
$commentText = $this->tickets ? preg_replace_callback(
|
||||
$this->tickets->getPattern(),
|
||||
array($this->tickets, 'createLink'),
|
||||
$this->escape($downtime->comment)
|
||||
|
@ -66,7 +66,7 @@ foreach ($object->downtimes as $downtime) {
|
|||
<?= $state ?>
|
||||
</td>
|
||||
<td style="padding-left: .5em;">
|
||||
<?= str_replace(array('\r\n', '\n'), '<br>', $text) ?>
|
||||
<?= nl2br($commentText) ?>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
Loading…
Reference in New Issue