Use constant for CSRF token.
This commit is contained in:
parent
0f5558d2e3
commit
a739afc32f
|
@ -1,4 +1,7 @@
|
||||||
<?php namespace Laravel; use Closure;
|
<?php namespace Laravel;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Laravel\Session\Payload as Session;
|
||||||
|
|
||||||
class Request {
|
class Request {
|
||||||
|
|
||||||
|
@ -121,12 +124,7 @@ public static function secure()
|
||||||
*/
|
*/
|
||||||
public static function forged()
|
public static function forged()
|
||||||
{
|
{
|
||||||
if (Config::$items['session']['driver'] == '')
|
return Input::get(Session::token) !== IoC::core('session')->token();
|
||||||
{
|
|
||||||
throw new \LogicException("A session driver must be specified to use the CSRF filter.");
|
|
||||||
}
|
|
||||||
|
|
||||||
return Input::get('csrf_token') !== IoC::core('session')->token();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -151,4 +149,4 @@ public static function route()
|
||||||
return static::$route;
|
return static::$route;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue