Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

V5 release #696

Merged
merged 8 commits into from
Dec 9, 2023
2 changes: 1 addition & 1 deletion src/Pecee/Http/Middleware/BaseCsrfVerifier.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ protected function skip(Request $request): bool
*/
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,
Expand Down
5 changes: 5 additions & 0 deletions src/Pecee/Http/Request.php
Original file line number Diff line number Diff line change
Expand Up @@ -405,6 +405,11 @@ public function setUrl(Url $url): 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;
}

Expand Down
5 changes: 0 additions & 5 deletions src/Pecee/Http/Url.php
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,6 @@ public function getHost(bool $includeTrails = false): ?string
*/
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;
Expand Down
1 change: 0 additions & 1 deletion src/Pecee/SimpleRouter/Router.php
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,6 @@ protected function handleException(Exception $e): ?string

if ($this->request->getRewriteRoute() !== null) {
$this->processedRoutes[] = $this->request->getRewriteRoute();
$this->request->setHasPendingRewrite(false);
}

return $this->routeRequest();
Expand Down
Loading