Skip to content

Commit 96cfdc3

Browse files
authored
Remove query params from current url
1 parent 05eb123 commit 96cfdc3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/AuthHelper.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,11 @@ public static function getCurrentUrl()
2828
else {
2929
$protocol = 'http';
3030
}
31+
32+
$url = $protocol . '://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
33+
$url = false !== ($qsPos = strpos($url, '?')) ? substr($url, 0, $qsPos) : $url; // remove query params
3134

32-
return "$protocol://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]";
35+
return $url;
3336
}
3437

3538
/**

0 commit comments

Comments
 (0)