Skip to content

Commit

Permalink
Merge pull request #931 from LuckyCyborg/master
Browse files Browse the repository at this point in the history
Optimizations and improvements on Routing
  • Loading branch information
daveismynamecom committed Jun 4, 2016
2 parents 9673f52 + d0f9e76 commit b98ea75
Show file tree
Hide file tree
Showing 5 changed files with 299 additions and 84 deletions.
4 changes: 3 additions & 1 deletion app/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@
Route::filter('csrf', function($route) {
$token = Request::input('csrfToken');

if (($route->method() == 'POST') && ($token != Session::token())) {
$method = Request::method();

if (($method == 'POST') && ($token != Session::token())) {
// When CSRF Token is invalid, respond with Error 400 Page (Bad Request)
return Response::error(400);
}
Expand Down
4 changes: 1 addition & 3 deletions system/Auth/Guard.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,7 @@ class Guard
* @param \Session\Store $session
* @return void
*/
public function __construct(UserProviderInterface $provider,
SessionStore $session,
Request $request = null)
public function __construct(UserProviderInterface $provider, SessionStore $session, Request $request = null)
{
$this->session = $session;
$this->request = $request;
Expand Down
4 changes: 2 additions & 2 deletions system/Routing/ClassicRouter.php
Original file line number Diff line number Diff line change
Expand Up @@ -93,11 +93,11 @@ public function dispatch()
// Found a valid Route; process it.
$this->matchedRoute = $route;

$callback = $route->callback();
$callback = $route->getCallback();

if (is_object($callback)) {
// Invoke the Route's Callback with the associated parameters.
call_user_func_array($callback, $route->params());
call_user_func_array($callback, $route->getParams());

return true;
}
Expand Down
Loading

0 comments on commit b98ea75

Please sign in to comment.