Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
fix(web): fix the comment deletion for host monitored by poller (#11138
Browse files Browse the repository at this point in the history
…) (#11556)

Refs: MON-12828

Co-authored-by: Stéphane Duret <sduret@centreon.com>
  • Loading branch information
kduret and s-duret authored Aug 10, 2022
1 parent 5308ae2 commit dc637bf
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion www/include/monitoring/comments/comments.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
if (!empty($select)) {
foreach ($select as $key => $value) {
$res = explode(';', urldecode($key));
DeleteComment($res[0], [(int)$res[1] . ';' . (int)$res[2] => 'on']);
DeleteComment($res[0], [$res[1] . ';' . (int)$res[2] => 'on']);
}
}
} else {
Expand Down
1 change: 0 additions & 1 deletion www/include/monitoring/comments/common-Func.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ function DeleteComment($type = null, $hosts = [])

foreach ($hosts as $key => $value) {
$res = preg_split("/\;/", $key);
$res[0] = filter_var($res[0] ?? 0, FILTER_VALIDATE_INT);
$res[1] = filter_var($res[1] ?? 0, FILTER_VALIDATE_INT);
write_command(" DEL_" . $type . "_COMMENT;" . $res[1], GetMyHostPoller($pearDB, $res[0]));
}
Expand Down

0 comments on commit dc637bf

Please sign in to comment.