mirror of
https://github.com/getgrav/grav.git
synced 2026-07-19 23:31:56 +02:00
Fixed Grav\Framework\Route::__toString() returning relative URL, not relative route
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
* Fixed issue with `redirect_trailing_slash` losing query string [#2269](https://github.com/getgrav/grav/issues/2269)
|
||||
* Fixed failed login if user attempts to log in with upper case non-english letters
|
||||
* Removed extra authenticated/authorized fields when saving existing user from a form
|
||||
* Fixed `Grav\Framework\Route::__toString()` returning relative URL, not relative route
|
||||
|
||||
# v1.6.0-beta.7
|
||||
## 12/14/2018
|
||||
|
||||
@@ -259,11 +259,12 @@ class Route
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $includeRoot
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
public function toString(bool $includeRoot = false)
|
||||
{
|
||||
$url = $this->getUriPath();
|
||||
$url = $this->getUriPath($includeRoot);
|
||||
|
||||
if ($this->queryParams) {
|
||||
$url .= '?' . $this->getUriQuery();
|
||||
@@ -272,6 +273,14 @@ class Route
|
||||
return $url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $type
|
||||
* @param string $param
|
||||
@@ -297,11 +306,12 @@ class Route
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $includeRoot
|
||||
* @return string
|
||||
*/
|
||||
protected function getUriPath()
|
||||
protected function getUriPath($includeRoot = false)
|
||||
{
|
||||
$parts = [$this->root];
|
||||
$parts = $includeRoot ? [$this->root] : [''];
|
||||
|
||||
if ($this->language !== '') {
|
||||
$parts[] = $this->language;
|
||||
|
||||
Reference in New Issue
Block a user