Render simple HTML links (a[href]) in acknowledgements, comments and downtimes

refs #10654
This commit is contained in:
Alexander A. Klimov 2016-02-16 14:55:27 +01:00
parent b0932d2413
commit af3abb76c8
7 changed files with 9 additions and 7 deletions

View File

@ -45,7 +45,7 @@
</tr>
<tr title="<?= $this->translate('A comment, as entered by the author, associated with the scheduled downtime'); ?>">
<th><?= $this->translate('Comment') ?></th>
<td class="comment-text"><?= $this->nl2br($this->escape($this->downtime->comment)) ?></td>
<td class="comment-text"><?= $this->nl2br($this->escapeComment($this->downtime->comment)) ?></td>
</tr>
</tbody>
</table>

View File

@ -56,5 +56,5 @@
</span>
</div>
<p class="comment-text">
<?= $this->nl2br($this->escape($comment->comment)) ?>
<?= $this->nl2br($this->escapeComment($comment->comment)) ?>
</p>

View File

@ -67,6 +67,6 @@
</span>
</div>
<p class="comment-text">
<?= $this->nl2br($this->escape($downtime->comment)) ?>
<?= $this->nl2br($this->escapeComment($downtime->comment)) ?>
</p>
</td>

View File

@ -147,7 +147,9 @@ $history->limit($limit * $page);
<?php if ($icon) {
echo $this->icon($icon, null, $iconCssClass ? array('class' => $iconCssClass) : array());
} ?>
<?= nl2br($this->createTicketLinks($this->escape($msg)), false) ?>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($msg)))
// TODO(ak): this allows only a[href] in messages, but plugin output allows more
?>
</p>
</td>
</tr>

View File

@ -44,7 +44,7 @@ $acknowledgement = $object->acknowledgement;
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escape($acknowledgement->getComment()))) ?>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($acknowledgement->getComment()))) ?>
</dd>
</dl>
<?php elseif (isset($removeAckForm)): ?>

View File

@ -67,7 +67,7 @@ if (empty($object->comments) && ! $addLink) {
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escape($comment->comment))) ?>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($comment->comment))) ?>
</dd>
<?php endforeach ?>
</dl>

View File

@ -96,7 +96,7 @@ if (empty($object->comments) && ! $addLink) {
} ?>
</dt>
<dd>
<?= $this->nl2br($this->createTicketLinks($this->escape($downtime->comment))) ?>
<?= $this->nl2br($this->createTicketLinks($this->escapeComment($downtime->comment))) ?>
</dd>
<?php endforeach ?>
</dl>