mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 12:42:16 +00:00
Bugfixes
- Fixed host not set on request url. - Url returns relativeUrl when calling toString() to avoid any issues when using in RouteUrl(url()) for rewrites.
This commit is contained in:
@@ -395,6 +395,10 @@ class Request
|
|||||||
{
|
{
|
||||||
$this->url = $url;
|
$this->url = $url;
|
||||||
|
|
||||||
|
if ($this->getHost() !== null) {
|
||||||
|
$url->setHost($this->getHost());
|
||||||
|
}
|
||||||
|
|
||||||
if ($this->isSecure() === true) {
|
if ($this->isSecure() === true) {
|
||||||
$this->url->setScheme('https');
|
$this->url->setScheme('https');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -541,7 +541,7 @@ class Url implements JsonSerializable
|
|||||||
|
|
||||||
public function __toString(): string
|
public function __toString(): string
|
||||||
{
|
{
|
||||||
return $this->getHost(true) . $this->getRelativeUrl();
|
return $this->getRelativeUrl();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user