Skip to content

Commit

Permalink
Merge pull request #434 from skipperbent/v4-development
Browse files Browse the repository at this point in the history
Version 4.2.0.6
  • Loading branch information
skipperbent authored Nov 24, 2018
2 parents ac594eb + d601e8e commit b715c48
Show file tree
Hide file tree
Showing 7 changed files with 149 additions and 181 deletions.
4 changes: 4 additions & 0 deletions .idea/encodings.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/php.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

311 changes: 135 additions & 176 deletions .idea/workspace.xml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Pecee/Http/Middleware/BaseCsrfVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

class BaseCsrfVerifier implements IMiddleware
{
public const POST_KEY = 'csrf-token';
public const POST_KEY = 'csrf_token';
public const HEADER_KEY = 'X-CSRF-TOKEN';

protected $except;
Expand Down
5 changes: 3 additions & 2 deletions src/Pecee/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,8 @@ public function __construct()

// Check if special IIS header exist, otherwise use default.
$this->setUrl(new Url($this->getHeader('unencoded-url', $this->getHeader('request-uri'))));


$this->method = strtolower($this->getHeader('request-method'));
$this->inputHandler = new InputHandler($this);
$this->method = strtolower($this->inputHandler->value('_method', $this->getHeader('request-method')));
}
Expand Down Expand Up @@ -425,4 +426,4 @@ public function __get($name)
return $this->data[$name] ?? null;
}

}
}
4 changes: 4 additions & 0 deletions src/Pecee/SimpleRouter/Route/Route.php
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,10 @@ public function renderRoute(Request $request, Router $router): ?string
$router->debug('Loading class %s', $className);
$class = $router->getClassLoader()->loadClass($className);

if (\count($controller) === 1) {
$controller[1] = '__invoke';
}

$method = $controller[1];

if (method_exists($class, $method) === false) {
Expand Down
2 changes: 1 addition & 1 deletion src/Pecee/SimpleRouter/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ protected function renderAndProcess(IRoute $route): void
$this->routeStack = [];

/* Route any routes added to the stack */
$this->processRoutes($stack, $route);
$this->processRoutes($stack, ($route instanceof IGroupRoute) ? $route : null);
}
}

Expand Down

0 comments on commit b715c48

Please sign in to comment.