Skip to content

Bug: Type 2 warning $ra recalculated with weaker logic, discarding time-window check #744

@somethingwithproof

Description

@somethingwithproof

Summary

In thold_functions.php (line ~3330), the carefully computed $ra (re-alert flag) for type 2 warnings gets unconditionally overwritten:

// Carefully computed using lastemailtime + realerttime window:
$ra = ($warning_failures > $warning_trigger && $thold_data['time_warning_fail_length']
    && !empty($lastemailtime) && ($lastemailtime + $realerttime <= time()));

// ... lots of code using $ra ...

// Then unconditionally OVERWRITTEN:
$ra = ($warning_failures > $warning_trigger) ? true : false;

The time-window check is discarded. The subject line says "is still" (re-alert phrasing) any time failures exceed trigger, even if the re-alert window has not elapsed. The thold_action hook also receives the wrong repeat_alert value.

Fix

Remove the second $ra assignment or move it before the first computation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions