From 04123643da499bac9eed8e8d1198a4c69148075f Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Wed, 21 May 2014 18:41:25 +0200 Subject: Server Setup page --- inc/util.inc.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'inc/util.inc.php') 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)) { -- cgit v1.2.3-55-g7522