Skip to content

Commit 5e11b6a

Browse files
authored
Fix the problem of urls that have a query parameters (#45)
* Fix the problem of urls having query params * Fix the problem of urls having query params
1 parent c8094ed commit 5e11b6a

2 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/Jobs/SamlSlo.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,12 @@ private function setDestination()
102102
$destination = $this->sp['logout'];
103103
$queryParams = $this->getQueryParams();
104104
if (!empty($queryParams)) {
105-
$destination = Str::finish(url($destination), '?') . Arr::query($queryParams);
105+
if (!parse_url($destination, PHP_URL_QUERY)){
106+
$destination = Str::finish(url($destination), '?') . Arr::query($queryParams);
107+
}
108+
else{
109+
$destination .= '&'.Arr::query($queryParams);
110+
}
106111
}
107112

108113
$this->destination = $destination;

src/Jobs/SamlSso.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,12 @@ private function setDestination()
174174

175175
$queryParams = $this->getQueryParams();
176176
if (!empty($queryParams)) {
177-
$destination = Str::finish(url($destination), '?') . Arr::query($queryParams);
177+
if (!parse_url($destination, PHP_URL_QUERY)){
178+
$destination = Str::finish(url($destination), '?') . Arr::query($queryParams);
179+
}
180+
else{
181+
$destination .= '&'.Arr::query($queryParams);
182+
}
178183
}
179184

180185
$this->destination = $destination;

0 commit comments

Comments
 (0)