mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 08:14:03 +02:00
monitoring: Fix `$this' usage in a closure
This commit is contained in:
parent
cde3ec6bc8
commit
c4d13a7850
@ -12,10 +12,11 @@
|
|||||||
<?php return; endif ?>
|
<?php return; endif ?>
|
||||||
|
|
||||||
<?php
|
<?php
|
||||||
function contactsLink($match, $self) {
|
$self = $this;
|
||||||
|
function contactsLink($match, $view) {
|
||||||
$links = array();
|
$links = array();
|
||||||
foreach (preg_split('/,\s/', $match[1]) as $contact) {
|
foreach (preg_split('/,\s/', $match[1]) as $contact) {
|
||||||
$links[] = $self->qlink($contact, 'monitoring/show/contact', array('contact' => $contact));
|
$links[] = $view->qlink($contact, 'monitoring/show/contact', array('contact' => $contact));
|
||||||
}
|
}
|
||||||
return '[' . implode(', ', $links) . ']';
|
return '[' . implode(', ', $links) . ']';
|
||||||
}
|
}
|
||||||
@ -39,7 +40,7 @@ function contactsLink($match, $self) {
|
|||||||
|
|
||||||
$msg = preg_replace_callback(
|
$msg = preg_replace_callback(
|
||||||
'/^\[([^\]]+)\]/',
|
'/^\[([^\]]+)\]/',
|
||||||
function($match) { return contactsLink($match, $this); },
|
function($match) use ($self) { return contactsLink($match, $self); },
|
||||||
$this->escape($event->output)
|
$this->escape($event->output)
|
||||||
);
|
);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user