[BUGFIX] Fixed issue with BaseCsrfVerifier matching urls against urls with parameters.

- Added optional $includeParams parameter to Url::getRelativeUrl method.
This commit is contained in:
Simon Sessingø
2021-04-01 03:04:32 +02:00
parent ca8fbf2b27
commit 52c6c226c0
5 changed files with 15 additions and 7 deletions
+6 -1
View File
@@ -427,10 +427,15 @@ class Url implements JsonSerializable
/**
* Returns the relative url
*
* @param bool $includeParams
* @return string
*/
public function getRelativeUrl(): string
public function getRelativeUrl($includeParams = true): string
{
if($includeParams === false) {
return rtrim($this->path, '/');
}
$params = $this->getQueryString();
$path = $this->path ?? '';