From 06d9d5f70e8475e768b528b1f46e1005b8c2e1ee Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 29 Jan 2015 20:41:41 +0100 Subject: Config.tgz improvements, automatic rebuilds etc. --- inc/util.inc.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'inc/util.inc.php') diff --git a/inc/util.inc.php b/inc/util.inc.php index d2ecba6f..4378a084 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -2,6 +2,7 @@ class Util { + private static $redirectParams = array(); /** * Displays an error message and stops script execution. @@ -69,9 +70,21 @@ SADFACE; $location .= '&' . $messages; } } + if (!empty(self::$redirectParams)) { + if (strpos($location, '?') === false) { + $location .= '?' . implode('&', self::$redirectParams); + } else { + $location .= '&' . implode('&', self::$redirectParams); + } + } Header('Location: ' . $location); exit(0); } + + public static function addRedirectParam($key, $value) + { + self::$redirectParams[] = $key .= '=' . urlencode($value); + } /** * Verify the user's token that protects agains CSRF. -- cgit v1.2.3-55-g7522