Compare commits

...

10 Commits

Author SHA1 Message Date
Simon Sessingø 2a2152432a Merge pull request #699 from skipperbent/v5-development
Version 5.4.1.5
2023-12-09 05:39:59 +01:00
Simon 0f55480156 Fixed rewrite-route not being executed in rare instances 2023-12-09 05:36:30 +01:00
Simon Sessingø 0b01aa9ba9 Merge pull request #698 from skipperbent/v5-development
Version 5.4.1.4
2023-11-29 01:22:27 +01:00
Simon 99ed44eb1e Fixed setHost nullable value 2023-11-29 01:20:00 +01:00
Simon Sessingø 14c21998e9 Merge pull request #695 from skipperbent/v5-development
Version 5.4.1.3
2023-11-27 08:08:55 +01:00
Simon 565a926bd3 Remove port from hostname 2023-11-27 08:06:35 +01:00
Simon Sessingø d75af212e9 Merge pull request #693 from skipperbent/v5-development
Version 5.4.1.2
2023-11-27 08:00:51 +01:00
Simon 64483652ff Strip any potential port number from hostname 2023-11-27 07:58:49 +01:00
Simon Sessingø 3c03f08edf Merge pull request #692 from skipperbent/v5-development
Version 5.4.1.1
2023-11-27 06:55:31 +01:00
Simon d17ee96221 Added better handling of domains on urls. 2023-11-27 06:53:33 +01:00
3 changed files with 13 additions and 8 deletions
+5 -4
View File
@@ -395,10 +395,6 @@ class Request
{
$this->url = $url;
if ($this->url->getHost() === null && $this->getHost() !== null) {
$this->url->setHost((string)$this->getHost());
}
if ($this->isSecure() === true) {
$this->url->setScheme('https');
}
@@ -409,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;
}
+8 -3
View File
@@ -144,10 +144,15 @@ class Url implements JsonSerializable
/**
* Get url host
*
* @param bool $includeTrails Prepend // in front of hostname
* @return string|null
*/
public function getHost(): ?string
public function getHost(bool $includeTrails = false): ?string
{
if ((string)$this->host !== '' && $includeTrails === true) {
return '//' . $this->host;
}
return $this->host;
}
@@ -530,12 +535,12 @@ class Url implements JsonSerializable
*/
public function jsonSerialize(): string
{
return $this->getRelativeUrl();
return $this->getHost(true) . $this->getRelativeUrl();
}
public function __toString(): string
{
return $this->getRelativeUrl();
return $this->getHost(true) . $this->getRelativeUrl();
}
}
-1
View File
@@ -562,7 +562,6 @@ class Router
if ($this->request->getRewriteRoute() !== null) {
$this->processedRoutes[] = $this->request->getRewriteRoute();
$this->request->setHasPendingRewrite(false);
}
return $this->routeRequest();