Skip to content

Commit

Permalink
Merge pull request #696 from skipperbent/v5-release
Browse files Browse the repository at this point in the history
V5 release
  • Loading branch information
skipperbent authored Dec 9, 2023
2 parents fdbd72c + 8923bee commit 7098f6a
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 7 deletions.
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

0 comments on commit 7098f6a

Please sign in to comment.