mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-18 09:17:52 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| d75af212e9 | |||
| 3c03f08edf | |||
| ef4756c45b | |||
| 36dda20bbe | |||
| e22ea70047 |
@@ -98,7 +98,7 @@ class BaseCsrfVerifier implements IMiddleware
|
||||
*/
|
||||
public function handle(Request $request): void
|
||||
{
|
||||
if ($this->skip($request) === false && ($request->isPostBack() === true || $request->isPostBack() === true && $this->isIncluded($request) === true)) {
|
||||
if ($this->skip($request) === false && ($request->isPostBack() === true || $this->isIncluded($request) === true)) {
|
||||
|
||||
$token = $request->getInputHandler()->value(
|
||||
static::POST_KEY,
|
||||
|
||||
@@ -405,11 +405,6 @@ 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) {
|
||||
if ($url !== null && $url !== '/') {
|
||||
$data = $this->parseUrl($url);
|
||||
|
||||
$this->scheme = $data['scheme'] ?? null;
|
||||
@@ -95,7 +95,6 @@ class Url implements JsonSerializable
|
||||
$this->setQueryString($data['query']);
|
||||
}
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
@@ -165,6 +164,11 @@ class Url implements JsonSerializable
|
||||
*/
|
||||
public function setHost(string $host): self
|
||||
{
|
||||
// Strip any potential ports from hostname
|
||||
if (strpos($host, ':') !== false) {
|
||||
$host = strstr($host, strrchr($host, ':'), true);
|
||||
}
|
||||
|
||||
$this->host = $host;
|
||||
|
||||
return $this;
|
||||
|
||||
@@ -562,6 +562,7 @@ 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