fix: Rebuild extra data to include original (#6245)

This commit is contained in:
Neil Lathwood
2017-03-23 08:23:01 +00:00
committed by GitHub
parent c32a41a5bf
commit 5d659a1b68

View File

@ -157,9 +157,9 @@ function RunRules($device)
}
foreach (GetRules($device) as $rule) {
c_echo('Rule %p#'.$rule['id'].' (' . $rule['name'] . '):%n ');
$inv = json_decode($rule['extra'], true);
if (isset($inv['invert'])) {
$inv = (bool) $inv['invert'];
$extra = json_decode($rule['extra'], true);
if (isset($extra['invert'])) {
$inv = (bool) $extra['invert'];
} else {
$inv = false;
}
@ -186,7 +186,9 @@ function RunRules($device)
} else { //( $s > 0 && $inv == false ) {
$doalert = false;
}
$extra = gzcompress(json_encode(array('contacts' => GetContacts($qry), 'rule'=>$qry)), 9);
$extra['contacts'] = GetContacts($qry);
$extra['rule'] = $qry;
$extra = gzcompress(json_encode($extra), 9);
if ($doalert) {
if ($chk['state'] === "2") {
c_echo('Status: %ySKIP');