Code cleanup to meet code standards.

This commit is contained in:
Daniel Thee Roperto
2016-11-14 19:20:46 +11:00
parent 5961e82b85
commit 7f264a85da
5 changed files with 22 additions and 14 deletions

View File

@@ -71,16 +71,6 @@ class outagelib {
return;
}
// Check if warning bar should be hidden.
if (optional_param('auth_outage_hide_warning', false, PARAM_BOOL)) {
return;
}
// Used to test the try block in case of errors.
if (PHPUNIT_TEST && optional_param('auth_outage_break_code', false, PARAM_INT)) {
(new stdClass())->invalidfield;
}
// Check for a previewing outage, then for an active outage.
$previewid = optional_param('auth_outage_preview', null, PARAM_INT);
$time = time();
@@ -200,6 +190,16 @@ class outagelib {
return false;
}
// Check if warning bar should be hidden.
if (optional_param('auth_outage_hide_warning', false, PARAM_BOOL)) {
return false;
}
// Used to test the try block in case of errors.
if (PHPUNIT_TEST && optional_param('auth_outage_break_code', false, PARAM_INT)) {
(new stdClass())->invalidfield; // Triggers an exception.
}
// Nothing preventing the injection.
return true;
}