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

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

View File

@ -120,7 +120,11 @@ if (! $this->compact): ?>
</div>
</td>
<?php foreach($this->addColumns as $col): ?>
<?php if ($service->$col && preg_match('~^_(host|service)_([a-zA-Z0-9_]+)$~', $col, $m)): ?>
<td><?= $this->escape(\Icinga\Module\Monitoring\Object\MonitoredObject::protectCustomVars([$m[2] => $service->$col])[$m[2]]) ?></td>
<?php else: ?>
<td><?= $this->escape($service->$col) ?></td>
<?php endif ?>
<?php endforeach ?>
</tr>
<?php endforeach ?>