diff options
author | Simon Rettberg | 2014-05-21 18:41:25 +0200 |
---|---|---|
committer | Simon Rettberg | 2014-05-21 18:41:25 +0200 |
commit | 04123643da499bac9eed8e8d1198a4c69148075f (patch) | |
tree | 7da0dd36344624df67926b5f6312f11eca24e040 /inc/util.inc.php | |
parent | JS Stuff for Taskmanager interaction (diff) | |
download | slx-admin-04123643da499bac9eed8e8d1198a4c69148075f.tar.gz slx-admin-04123643da499bac9eed8e8d1198a4c69148075f.tar.xz slx-admin-04123643da499bac9eed8e8d1198a4c69148075f.zip |
Server Setup page
Diffstat (limited to 'inc/util.inc.php')
-rw-r--r-- | inc/util.inc.php | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/inc/util.inc.php b/inc/util.inc.php index 8235edd0..4b974f6d 100644 --- a/inc/util.inc.php +++ b/inc/util.inc.php @@ -25,9 +25,13 @@ class Util * Redirects the user via a '302 Moved' header. * An active session will be saved, any messages that haven't * been displayed yet will be appended to the redirect. + * @param string $location Location to redirect to. "false" to redirect to same URL (useful after POSTs) */ - public static function redirect($location) + public static function redirect($location = false) { + if ($location === false) { + $location = preg_replace('/(&|\?)message\[\]\=[^&]*(&|$)/', '\1', $_SERVER['REQUEST_URI']); + } Session::save(); $messages = Message::toRequest(); if (!empty($messages)) { |