diff options
author | Simon Rettberg | 2015-01-29 20:41:41 +0100 |
---|---|---|
committer | Simon Rettberg | 2015-01-29 20:41:41 +0100 |
commit | 06d9d5f70e8475e768b528b1f46e1005b8c2e1ee (patch) | |
tree | a2355836c9128cf4d5aa3939c48bad635ed768b8 /inc/util.inc.php | |
parent | [sysconfig] Add legend (diff) | |
download | slx-admin-06d9d5f70e8475e768b528b1f46e1005b8c2e1ee.tar.gz slx-admin-06d9d5f70e8475e768b528b1f46e1005b8c2e1ee.tar.xz slx-admin-06d9d5f70e8475e768b528b1f46e1005b8c2e1ee.zip |
Config.tgz improvements, automatic rebuilds etc.
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r-- | inc/util.inc.php | 13 |
1 files changed, 13 insertions, 0 deletions
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. |