public function __invoke() { if ((Request::IsPut() || Request::IsPost() || Request::IsDelete()) && Request::$Controller->GetCsrfValidation()) { if (!is_null(Request::Post(Csrf::GetName()))) { if (Csrf::Verify(Request::Post(Csrf::GetName()))) { unset($_POST[Csrf::GetName()]); return self::Next(); } } Response::Status(403); trigger_error('Csrf token is invalid', E_USER_ERROR); } self::Next(); }
function old($key, $value = null) { return Request::old($key, $value); }
/** * fungsi yang akan dijalankan setelah controller dijalankan. */ private static function after() { if (!Request::isAjax()) { Session::clearFlash(); } }