Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 function old($key, $value = null)
 {
     return Request::old($key, $value);
 }
Exemplo n.º 3
0
 /**
  * fungsi yang akan dijalankan setelah controller dijalankan.
  */
 private static function after()
 {
     if (!Request::isAjax()) {
         Session::clearFlash();
     }
 }