summaryrefslogtreecommitdiffstats
path: root/inc/util.inc.php
diff options
context:
space:
mode:
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r--inc/util.inc.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php
index 2568011b..0ff6fdad 100644
--- a/inc/util.inc.php
+++ b/inc/util.inc.php
@@ -15,9 +15,10 @@ class Util
*
* @param string|false $location Location to redirect to. "false" to redirect to same URL (useful after POSTs)
* @param bool $preferRedirectPost if true, use the value from $_POST['redirect'] instead of $location
+ * @param bool $ignoreRedirectParams if true, ignore any additional params set via ::addRedirectParam())
*/
#[NoReturn]
- public static function redirect($location = false, bool $preferRedirectPost = false): void
+ public static function redirect($location = false, bool $preferRedirectPost = false, bool $ignoreRedirectParams = false): void
{
if ($location === false) {
$location = preg_replace('/([&?])message\[\]=[^&]*/', '\1', $_SERVER['REQUEST_URI']);
@@ -35,7 +36,7 @@ class Util
$location .= '&' . $messages;
}
}
- if (!empty(self::$redirectParams)) {
+ if (!$ignoreRedirectParams && !empty(self::$redirectParams)) {
if (strpos($location, '?') === false) {
$location .= '?' . implode('&', self::$redirectParams);
} else {