Fix previous checkin to conform to RFC (Location header expects complete URL)

svn path=/trunk/boinc/; revision=13413
This commit is contained in:
Rytis Slatkevičius 2007-08-18 16:45:54 +00:00
parent 882d20b226
commit bc17c8ab45
3 changed files with 22 additions and 2 deletions

View File

@ -7988,4 +7988,6 @@ Rytis 18 Aug 2007
html/
user/forum_index.php
inc/forum.inc
inc/
forum.inc
util.inc

View File

@ -418,7 +418,7 @@ function show_forum_title($forum=NULL, $thread=NULL, $extended=true) {
if ($logged_in_user) {
echo "<td align=\"right\">\n";
$return = urlencode($_SERVER["SCRIPT_NAME"]."?".$_SERVER["QUERY_STRING"]);
$return = urlencode(current_url());
echo "<a href=\"forum_index.php?read=1&amp;".url_tokens($logged_in_user->authenticator)."&amp;return=".$return."\">Mark all threads as read</a><br />\n";
// Private messages

View File

@ -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;
}
?>