mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-06-17 08:47:52 +00:00
@@ -98,7 +98,7 @@ class BaseCsrfVerifier implements IMiddleware
|
|||||||
*/
|
*/
|
||||||
public function handle(Request $request): void
|
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(
|
$token = $request->getInputHandler()->value(
|
||||||
static::POST_KEY,
|
static::POST_KEY,
|
||||||
|
|||||||
@@ -405,6 +405,11 @@ class Request
|
|||||||
*/
|
*/
|
||||||
public function setHost(?string $host): void
|
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;
|
$this->host = $host;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -164,11 +164,6 @@ class Url implements JsonSerializable
|
|||||||
*/
|
*/
|
||||||
public function setHost(string $host): self
|
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;
|
$this->host = $host;
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
|
|||||||
@@ -562,7 +562,6 @@ class Router
|
|||||||
|
|
||||||
if ($this->request->getRewriteRoute() !== null) {
|
if ($this->request->getRewriteRoute() !== null) {
|
||||||
$this->processedRoutes[] = $this->request->getRewriteRoute();
|
$this->processedRoutes[] = $this->request->getRewriteRoute();
|
||||||
$this->request->setHasPendingRewrite(false);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->routeRequest();
|
return $this->routeRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user