diff --git a/controllers/ManageErrors.php b/controllers/ManageErrors.php index 32069dd6..b1e66c89 100644 --- a/controllers/ManageErrors.php +++ b/controllers/ManageErrors.php @@ -15,13 +15,18 @@ class ManageErrors extends HTMLController throw new NotAllowedException(); // Flushing, are we? - if (isset($_POST['flush'])) + if (isset($_POST['flush']) && Session::validateSession('get')) + { ErrorLog::flush(); + header('Location: ' . BASEURL . '/manageerrors/'); + } + + Session::resetSessionToken(); $options = [ 'title' => 'Error log', 'form' => [ - 'action' => BASEURL . '/manageerrors/', + 'action' => BASEURL . '/manageerrors/?' . Session::getSessionTokenKey() . '=' . Session::getSessionToken(), 'method' => 'post', 'class' => 'floatright', 'buttons' => [