Codechecker fixes and removed other comments.

This commit is contained in:
abhinavgandham
2026-01-20 15:18:21 +10:00
committed by Brendan Heywood
parent 0bff6f5145
commit ffda33329c
5 changed files with 5 additions and 8 deletions

View File

@@ -136,7 +136,7 @@ class edit extends moodleform {
}
$outagedata = [
'id' => ($data->id === 0) ? null : $data->id,
// 'autostart' => (isset($data->autostart) && ($data->autostart == 1)),
'autostart' => (isset($data->autostart) && ($data->autostart == 1)),
'starttime' => $data->starttime,
'stoptime' => $data->starttime + $data->outageduration,
'warntime' => $data->starttime - $data->warningduration,
@@ -161,7 +161,7 @@ class edit extends moodleform {
if ($outage instanceof outage) {
$this->_form->setDefaults([
'id' => $outage->id,
// 'autostart' => $outage->autostart,
'autostart' => $outage->autostart,
'starttime' => $outage->starttime,
'outageduration' => $outage->get_duration_planned(),
'warningduration' => $outage->get_warning_duration(),

View File

@@ -371,7 +371,8 @@ EOT;
'{{YOURIP}}', '{{COOKIESECURE}}', '{{COOKIEHTTPONLY}}', '{{METADATA}}'];
// Note that var_export is required because (string) false == '', not 'false'.
$replace = [$starttime, $stoptime, var_export(!empty($allowedips), true), $allowedips, var_export(!empty($accesskey), true),
$accesskey, getremoteaddr('n/a'), var_export($cookiesecure, true), var_export($cookiehttponly, true), var_export($metadata, true)];
$accesskey, getremoteaddr('n/a'), var_export($cookiesecure, true),
var_export($cookiehttponly, true), var_export($metadata, true)];
return str_replace($search, $replace, $code);
}