monitoring: Don't use str_replace for nl2br and escape comments before creating ticket links

This commit is contained in:
Eric Lippmann 2015-11-03 10:40:03 +01:00
parent 55f0863649
commit c0bc2e267e
5 changed files with 5 additions and 5 deletions

View File

@ -92,7 +92,7 @@ if (! $this->compact): ?>
<?= $this->link()->host($event->host_name, $event->host_display_name) ?>
<?php endif ?>
<p class="plugin-output">
<?= empty($msg) ? '' : $this->escape($msg) ?>
<?= nl2br($this->createTicketLinks($this->escape($msg)), false) ?>
</p>
</td>
</tr>

View File

@ -70,7 +70,7 @@ if (! $this->compact): ?>
$service->host_display_name
)
)
) ?>:
) ?>&#58;
<?php endif ?><?= $this->qlink(
$service->service_display_name,
$serviceLink,

View File

@ -46,7 +46,7 @@ $acknowledgement = $object->acknowledgement;
</span>
</dt>
<dd class="comment-text">
<p><?= nl2br($this->createTicketLinks($acknowledgement->getComment()), false) ?></p>
<p><?= nl2br($this->createTicketLinks($this->escape($acknowledgement->getComment())), false) ?></p>
</dd>
</dl>
</td>

View File

@ -69,7 +69,7 @@ if (empty($object->comments) && ! $addLink) {
</span>
</dt>
<dd class="comment-text">
<?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($comment->comment)) ?>
<p><?= nl2br($this->createTicketLinks($this->escape($comment->comment)), false) ?></p>
</dd>
<?php endforeach ?>
</dl>

View File

@ -99,7 +99,7 @@ if (empty($object->comments) && ! $addLink) {
</span>
</dt>
<dd class="comment-text">
<p><?= str_replace(array('\r\n', '\n'), '<br>', $this->createTicketLinks($downtime->comment)) ?></p>
<p><?= nl2br($this->createTicketLinks($this->escape($downtime->comment)), false) ?></p>
</dd>
<?php endforeach ?>
</dl>