Welcome Guest, Not a member yet? Register   Sign In
Change default page for csrf error
#4

(07-26-2018, 04:09 PM)daveĀ friend Wrote: So, one way to get what you want would be to extend CI_Securtity and redefine the method csrf_show_error(). Something along these (untested) lines.

PHP Code:
class MY_Security extends CI_Security
{
 public function 
csrf_show_error()
 {
 
$heading "Be gone fool!";
 
$message "You shall not pass!";

 
$_error = & load_class('Exceptions''core');
 echo 
$_error->show_error($heading$message'csrf_error'403);
 exit;
 }


Basically what happens above is you bypass the common function and go straight to the CI_Exceptions class passing the name of your custom view - which I call "csrf_error".

You need to create the view file /application/views/errors/html/csrf_error.php that meets your objectives.

Wow, thanks. I will try that
Reply


Messages In This Thread
RE: Change default page for csrf error - by anthos1984 - 07-28-2018, 12:19 AM



Theme © iAndrew 2016 - Forum software by © MyBB