monitoring/list/hosts: Protect custom variables added with `?addColumns`

This commit is contained in:
Johannes Meyer 2021-02-02 16:01:29 +01:00
parent 1dc6f35916
commit c953e4f92d
1 changed files with 4 additions and 0 deletions

View File

@ -92,7 +92,11 @@ if (! $this->compact): ?>
<p class="overview-plugin-output"><?= $this->pluginOutput($this->ellipsis($host->host_output, 10000), true, $host->host_check_command) ?></p>
</td>
<?php foreach($this->addColumns as $col): ?>
<?php if ($host->$col && preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $col, $m)): ?>
<td><?= $this->escape(\Icinga\Module\Monitoring\Object\MonitoredObject::protectCustomVars([$m[2] => $host->$col])[$m[2]]) ?></td>
<?php else: ?>
<td><?= $this->escape($host->$col) ?></td>
<?php endif ?>
<?php endforeach ?>
</tr>
<?php endforeach ?>