mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
Compare commits
18 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| b98d40b84b | |||
| a2843d5b1e | |||
| 0634ba79dc | |||
| 7098f6a2e1 | |||
| 8923beeacf | |||
| 3534233a76 | |||
| 2a2152432a | |||
| 0f55480156 | |||
| 0b01aa9ba9 | |||
| 99ed44eb1e | |||
| 14c21998e9 | |||
| 565a926bd3 | |||
| fdbd72c30d | |||
| d75af212e9 | |||
| 64483652ff | |||
| b23f6a0773 | |||
| ca053a68a0 | |||
| fd0237ee6a |
@@ -98,7 +98,7 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
*/
|
||||
public function handle(Request $request): void
|
||||
{
|
||||
if ($this->skip($request) === false && ($request->isPostBack() === true || $this->isIncluded($request) === true)) {
|
||||
if ($this->skip($request) === false && ($request->isPostBack() === true || $request->isPostBack() === true && $this->isIncluded($request) === true)) {
|
||||
|
||||
$token = $request->getInputHandler()->value(
|
||||
static::POST_KEY,
|
||||
|
||||
@@ -405,6 +405,11 @@ class Request
|
||||
*/
|
||||
public function setHost(?string $host): void
|
||||
{
|
||||
// Strip any potential ports from hostname
|
||||
if (strpos((string)$host, ':') !== false) {
|
||||
$host = strstr($host, strrchr($host, ':'), true);
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
}
|
||||
|
||||
|
||||
@@ -72,7 +72,7 @@ class Url implements JsonSerializable
|
||||
|
||||
public function parse(?string $url, bool $setOriginalPath = false): self
|
||||
{
|
||||
if ($url !== null && $url !== '/') {
|
||||
if ($url !== null) {
|
||||
$data = $this->parseUrl($url);
|
||||
|
||||
$this->scheme = $data['scheme'] ?? null;
|
||||
@@ -95,6 +95,7 @@ class Url implements JsonSerializable
|
||||
$this->setQueryString($data['query']);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
@@ -562,7 +562,6 @@ class Router
|
||||
|
||||
if ($this->request->getRewriteRoute() !== null) {
|
||||
$this->processedRoutes[] = $this->request->getRewriteRoute();
|
||||
$this->request->setHasPendingRewrite(false);
|
||||
}
|
||||
|
||||
return $this->routeRequest();
|
||||
|
||||
Reference in New Issue
Block a user