From bc17c8ab45ef1728f8865e5cebf845010801fd70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rytis=20Slatkevi=C4=8Dius?= Date: Sat, 18 Aug 2007 16:45:54 +0000 Subject: [PATCH] Fix previous checkin to conform to RFC (Location header expects complete URL) svn path=/trunk/boinc/; revision=13413 --- checkin_notes | 4 +++- html/inc/forum.inc | 2 +- html/inc/util.inc | 18 ++++++++++++++++++ 3 files changed, 22 insertions(+), 2 deletions(-) diff --git a/checkin_notes b/checkin_notes index a1796b6a24..ab5d4bbb94 100755 --- a/checkin_notes +++ b/checkin_notes @@ -7988,4 +7988,6 @@ Rytis 18 Aug 2007 html/ user/forum_index.php - inc/forum.inc + inc/ + forum.inc + util.inc diff --git a/html/inc/forum.inc b/html/inc/forum.inc index d5008d6a18..edf4a11a80 100644 --- a/html/inc/forum.inc +++ b/html/inc/forum.inc @@ -418,7 +418,7 @@ function show_forum_title($forum=NULL, $thread=NULL, $extended=true) { if ($logged_in_user) { echo "\n"; - $return = urlencode($_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"]); + $return = urlencode(current_url()); echo "authenticator)."&return=".$return."\">Mark all threads as read
\n"; // Private messages diff --git a/html/inc/util.inc b/html/inc/util.inc index c4751bb61a..f1fdbc2c46 100644 --- a/html/inc/util.inc +++ b/html/inc/util.inc @@ -707,4 +707,22 @@ function strip_bbcode($string){ return preg_replace("/((\[.+\])+?)(.+?)((\[\/.+\])+?)/","",$string); } +function current_url() { + $url = "http"; + if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { + $url .= "s"; + } + $url .= "://"; + $url .= $_SERVER['SERVER_NAME']; + $url .= ":".$_SERVER['SERVER_PORT']; + if (isset($_SERVER['REQUEST_URI'])) { + $url .= $_SERVER['REQUEST_URI']; + } else { + if ($_SERVER['QUERY_STRING']) { + $url .= "?".$_SERVER['QUERY_STRING']; + } + } + return $url; +} + ?>