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) {
|
foreach ($object->comments as $comment) {
|
||||||
// Ticket hook sample
|
// Ticket hook sample
|
||||||
$text = $this->tickets ? preg_replace_callback(
|
$commentText = $this->tickets ? preg_replace_callback(
|
||||||
$this->tickets->getPattern(),
|
$this->tickets->getPattern(),
|
||||||
array($this->tickets, 'createLink'),
|
array($this->tickets, 'createLink'),
|
||||||
$this->escape($comment->comment)
|
$this->escape($comment->comment)
|
||||||
|
@ -56,7 +56,7 @@ foreach ($object->comments as $comment) {
|
||||||
(<?= ucfirst($comment->type) ?>):
|
(<?= ucfirst($comment->type) ?>):
|
||||||
</td>
|
</td>
|
||||||
<td style="padding-left: .5em;">
|
<td style="padding-left: .5em;">
|
||||||
<?= str_replace(array('\r\n', '\n'), '<br>', $text) ?>
|
<?= nl2br($commentText) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
|
@ -34,7 +34,7 @@
|
||||||
|
|
||||||
foreach ($object->downtimes as $downtime) {
|
foreach ($object->downtimes as $downtime) {
|
||||||
// Ticket hook sample
|
// Ticket hook sample
|
||||||
$text = $this->tickets ? preg_replace_callback(
|
$commentText = $this->tickets ? preg_replace_callback(
|
||||||
$this->tickets->getPattern(),
|
$this->tickets->getPattern(),
|
||||||
array($this->tickets, 'createLink'),
|
array($this->tickets, 'createLink'),
|
||||||
$this->escape($downtime->comment)
|
$this->escape($downtime->comment)
|
||||||
|
@ -66,7 +66,7 @@ foreach ($object->downtimes as $downtime) {
|
||||||
<?= $state ?>
|
<?= $state ?>
|
||||||
</td>
|
</td>
|
||||||
<td style="padding-left: .5em;">
|
<td style="padding-left: .5em;">
|
||||||
<?= str_replace(array('\r\n', '\n'), '<br>', $text) ?>
|
<?= nl2br($commentText) ?>
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
Loading…
Reference in New Issue