redirect header changes

git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3154 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Paul S. Owen 2002-11-30 21:37:45 +00:00
parent 6de7055e80
commit 4ef1441bea
16 changed files with 71 additions and 127 deletions

View file

@ -50,11 +50,9 @@ if (empty($HTTP_POST_VARS['send_file']))
require('./pagestart.' . $phpEx); require('./pagestart.' . $phpEx);
} }
if( $cancel ) if ($cancel)
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect('admin/' . append_sid("admin_styles.$phpEx", true));
header($header_location . append_sid("admin_styles.$phpEx"));
exit;
} }
if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )

View file

@ -40,9 +40,7 @@ init_userprefs($userdata);
if (!$userdata['session_logged_in']) if (!$userdata['session_logged_in'])
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=admin/", true));
header($header_location . '../' . append_sid("login.$phpEx?redirect=admin/"));
exit;
} }
else if ($userdata['user_level'] != ADMIN) else if ($userdata['user_level'] != ADMIN)
{ {
@ -55,9 +53,7 @@ if ($HTTP_GET_VARS['sid'] != $userdata['session_id'])
$url = preg_replace('/\?$/', '', $url); $url = preg_replace('/\?$/', '', $url);
$url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $userdata['session_id']; $url .= ((strpos($url, '?')) ? '&' : '?') . 'sid=' . $userdata['session_id'];
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect($url);
header($header_location . $url);
exit;
} }
if (empty($no_page_header)) if (empty($no_page_header))

View file

@ -119,7 +119,7 @@ h3 {font-size:12pt;color:blue}
<li>Fixed non-pruning of watched topics table when pruning related topics</li> <li>Fixed non-pruning of watched topics table when pruning related topics</li>
<li>Enable GET redirect on logout</li> <li>Enable GET redirect on logout</li>
<li>Added check for IE6.x to viewtopic ICQ indicator javascript</li> <li>Added check for IE6.x to viewtopic ICQ indicator javascript</li>
<li>Fixed empty username quoting owith MS-SQL</li> <li>Fixed empty username quoting with MS-SQL</li>
<li>Fixed BBCode url, magic url and img tags to allow most chars beyond domain names</li> <li>Fixed BBCode url, magic url and img tags to allow most chars beyond domain names</li>
<li>Prevent parsing of -ve size values in BBCode size tag</li> <li>Prevent parsing of -ve size values in BBCode size tag</li>
<li>Back ported HTML handler from 2.2, this may impact some boards which allow complex HTML - existing parser remains but commented out</li> <li>Back ported HTML handler from 2.2, this may impact some boards which allow complex HTML - existing parser remains but commented out</li>
@ -130,7 +130,8 @@ h3 {font-size:12pt;color:blue}
<li>Fixes for paths under Apache2</li> <li>Fixes for paths under Apache2</li>
<li>Added wrap text with tag support for posting in Mozilla 1.1+</li> <li>Added wrap text with tag support for posting in Mozilla 1.1+</li>
<li>Fixed use of missing CSS classes in modcp_split, group_info_body, error_body and agreement</li> <li>Fixed use of missing CSS classes in modcp_split, group_info_body, error_body and agreement</li>
<li></li> <li>Fixed ability of users to edit polls even after they have received votes</li>
<li>Fixed header Location to be absolute URL as per HTTP 1.1 spec - noted by <b>PhilippK</b></li>
<li></li> <li></li>
</ul> </ul>

View file

@ -151,15 +151,13 @@ $start = ( isset($HTTP_GET_VARS['start']) ) ? intval($HTTP_GET_VARS['start']) :
// //
// Default var values // Default var values
// //
$header_location = ( @preg_match('/Microsoft|WebSTAR/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
$is_moderator = FALSE; $is_moderator = FALSE;
if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id ) if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
exit;
} }
$sql = "SELECT group_moderator $sql = "SELECT group_moderator
@ -208,8 +206,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id )
// //
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
exit;
} }
$sql = "SELECT ug.user_id, g.group_type $sql = "SELECT ug.user_id, g.group_type
@ -310,13 +307,11 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending
// //
if ( $cancel ) if ( $cancel )
{ {
header($header_location . append_sid("groupcp.$phpEx", true)); redirect(append_sid("groupcp.$phpEx", true));
exit;
} }
elseif ( !$userdata['session_logged_in'] ) elseif ( !$userdata['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
exit;
} }
if ( $confirm ) if ( $confirm )
@ -399,8 +394,7 @@ else if ( $group_id )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
exit;
} }
} }
@ -461,8 +455,7 @@ else if ( $group_id )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); redirect(append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true));
exit;
} }
if ( !$is_moderator ) if ( !$is_moderator )

View file

@ -690,4 +690,25 @@ if ( !function_exists(realpath) )
return $path; return $path;
} }
} }
?>
function redirect($url)
{
global $board_config;
$server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://';
$server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['server_name']));
$script_name = preg_replace('/^\/?(.*?)\/?$/', '/\1', trim($board_config['script_path']));
$server_port = ($board_config['server_port'] <> 80) ? ':' . trim($board_config['server_port']) . '/' : '/';
$url = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($url));
// If redirects don't work for you, first make sure you've entered your server (domain) name,
// script path, protocol (insecure (http://) or secure (https://) cookie) and port
// correctly in admin -> general -> configuration ... if they are fine, uncomment the following
// line and replace 'Location: ' . with $header_location . in the line following it.
// $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
header('Location: ' . $server_protocol . $server_name . $script_name . $server_port . $url);
exit;
}
?>

View file

@ -303,7 +303,7 @@ function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_
// //
// Add poll // Add poll
// //
if ( ( $mode == 'newtopic' || $mode == 'editpost' ) && !empty($poll_title) && count($poll_options) >= 2 ) if (($mode == 'newtopic' || ($mode == 'editpost' && $post_data['edit_poll'])) && !empty($poll_title) && count($poll_options) >= 2)
{ {
$sql = ( !$post_data['has_poll'] ) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ( $poll_length * 86400 ) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ( $poll_length * 86400 ) . " WHERE topic_id = $topic_id"; $sql = ( !$post_data['has_poll'] ) ? "INSERT INTO " . VOTE_DESC_TABLE . " (topic_id, vote_text, vote_start, vote_length) VALUES ($topic_id, '$poll_title', $current_time, " . ( $poll_length * 86400 ) . ")" : "UPDATE " . VOTE_DESC_TABLE . " SET vote_text = '$poll_title', vote_length = " . ( $poll_length * 86400 ) . " WHERE topic_id = $topic_id";
if ( !$db->sql_query($sql) ) if ( !$db->sql_query($sql) )

View file

@ -38,8 +38,7 @@ else
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
header('Location: ' . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true)); redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=email&" . POST_USERS_URL . "=$user_id", true));
exit;
} }
$sql = "SELECT username, user_email, user_viewemail, user_lang $sql = "SELECT username, user_email, user_viewemail, user_lang

View file

@ -40,8 +40,6 @@ init_userprefs($userdata);
// End session management // End session management
// //
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($HTTP_POST_VARS['logout']) || isset($HTTP_GET_VARS['logout']) ) if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($HTTP_POST_VARS['logout']) || isset($HTTP_GET_VARS['logout']) )
{ {
// //
@ -66,8 +64,7 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
{ {
if( $row['user_level'] != ADMIN && $board_config['board_disable'] ) if( $row['user_level'] != ADMIN && $board_config['board_disable'] )
{ {
header($header_location . append_sid("index.$phpEx", true)); redirect(append_sid("index.$phpEx", true));
exit;
} }
else else
{ {
@ -79,16 +76,8 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
if( $session_id ) if( $session_id )
{ {
if( !empty($HTTP_POST_VARS['redirect']) ) $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "index.$phpEx";
{ redirect(append_sid($url, true));
header($header_location . append_sid($HTTP_POST_VARS['redirect'], true));
exit;
}
else
{
header($header_location . append_sid("index.$phpEx", true));
exit;
}
} }
else else
{ {
@ -133,28 +122,18 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($
if (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect'])) if (!empty($HTTP_POST_VARS['redirect']) || !empty($HTTP_GET_VARS['redirect']))
{ {
$redirect = (!empty($HTTP_POST_VARS['redirect'])) ? $HTTP_POST_VARS['redirect'] : $HTTP_GET_VARS['redirect']; $url = (!empty($HTTP_POST_VARS['redirect'])) ? $HTTP_POST_VARS['redirect'] : $HTTP_GET_VARS['redirect'];
header($header_location . append_sid($redirect, true)); redirect(append_sid($url, true));
exit;
} }
else else
{ {
header($header_location . append_sid("index.$phpEx", true)); redirect(append_sid("index.$phpEx", true));
exit;
} }
} }
else else
{ {
if( !empty($HTTP_POST_VARS['redirect']) ) $url = ( !empty($HTTP_POST_VARS['redirect']) ) ? $HTTP_POST_VARS['redirect'] : "index.$phpEx";
{ redirect(append_sid($url, true));
header($header_location . append_sid($HTTP_POST_VARS['redirect'], true));
exit;
}
else
{
header($header_location . append_sid("index.$phpEx", true));
exit;
}
} }
} }
else else
@ -231,10 +210,9 @@ else
} }
else else
{ {
header($header_location . append_sid("index.$phpEx", true)); redirect(append_sid("index.$phpEx", true));
exit;
} }
} }
?> ?>

View file

@ -171,9 +171,7 @@ if ( isset($HTTP_POST_VARS['cancel']) )
$redirect = "index.$phpEx"; $redirect = "index.$phpEx";
} }
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid($redirect, true));
header($header_location . append_sid($redirect, true));
exit;
} }
// //

View file

@ -116,9 +116,7 @@ if ( isset($HTTP_POST_VARS['cancel']) )
$post_append = ''; $post_append = '';
} }
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid($redirect, true) . $post_append);
header($header_location . append_sid($redirect, true) . $post_append);
exit;
} }
// //
@ -368,9 +366,7 @@ if ( !$is_auth[$is_auth_type] )
break; break;
} }
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
header($header_location . append_sid("login.$phpEx?redirect=posting.$phpEx&" . $redirect, true));
exit;
} }
// //
@ -1063,7 +1059,7 @@ $template->assign_vars(array(
// //
// Poll entry switch/output // Poll entry switch/output
// //
if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['first_post'] ) ) && $is_auth['auth_pollcreate'] ) if( ( $mode == 'newtopic' || ( $mode == 'editpost' && $post_data['edit_poll']) ) && $is_auth['auth_pollcreate'] )
{ {
$template->assign_vars(array( $template->assign_vars(array(
'L_ADD_A_POLL' => $lang['Add_poll'], 'L_ADD_A_POLL' => $lang['Add_poll'],

View file

@ -83,9 +83,7 @@ init_userprefs($userdata);
// //
if ( $cancel ) if ( $cancel )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
exit;
} }
// //
@ -183,9 +181,7 @@ else if ( $mode == 'read' )
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true));
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true));
exit;
} }
// //
@ -245,9 +241,7 @@ else if ( $mode == 'read' )
// //
if ( !($privmsg = $db->sql_fetchrow($result)) ) if ( !($privmsg = $db->sql_fetchrow($result)) )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
exit;
} }
$privmsg_id = $privmsg['privmsgs_id']; $privmsg_id = $privmsg['privmsgs_id'];
@ -648,9 +642,7 @@ else if ( ( $delete && $mark_list ) || $delete_all )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
exit;
} }
if ( isset($mark_list) && !is_array($mark_list) ) if ( isset($mark_list) && !is_array($mark_list) )
{ {
@ -847,9 +839,7 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' )
{ {
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
exit;
} }
// //
@ -953,9 +943,7 @@ else if ( $submit || $refresh || $mode != '' )
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? '&' . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]) : ''; $user_id = ( isset($HTTP_GET_VARS[POST_USERS_URL]) ) ? '&' . POST_USERS_URL . '=' . intval($HTTP_GET_VARS[POST_USERS_URL]) : '';
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true));
exit;
} }
// //
@ -1319,9 +1307,7 @@ else if ( $submit || $refresh || $mode != '' )
if ( !($privmsg = $db->sql_fetchrow($result)) ) if ( !($privmsg = $db->sql_fetchrow($result)) )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
exit;
} }
$privmsg_subject = $privmsg['privmsgs_subject']; $privmsg_subject = $privmsg['privmsgs_subject'];
@ -1359,9 +1345,7 @@ else if ( $submit || $refresh || $mode != '' )
if ( !($privmsg = $db->sql_fetchrow($result)) ) if ( !($privmsg = $db->sql_fetchrow($result)) )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("privmsg.$phpEx?folder=$folder", true));
header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true));
exit;
} }
$privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject']; $privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject'];
@ -1691,9 +1675,7 @@ else if ( $submit || $refresh || $mode != '' )
// //
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect(append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true));
exit;
} }
// //

View file

@ -83,9 +83,7 @@ if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
{ {
if ( !$userdata['session_logged_in'] && $mode == 'editprofile' ) if ( !$userdata['session_logged_in'] && $mode == 'editprofile' )
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect(append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
header($header_location . append_sid("login.$phpEx?redirect=profile.$phpEx&mode=editprofile", true));
exit;
} }
include($phpbb_root_path . 'includes/usercp_register.'.$phpEx); include($phpbb_root_path . 'includes/usercp_register.'.$phpEx);
@ -109,9 +107,7 @@ if ( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) )
} }
else else
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect(append_sid("index.$phpEx", true));
header($header_location . append_sid("index.$phpEx", true));
exit;
} }
?> ?>

View file

@ -162,8 +162,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else else
{ {
header("Location: login.$phpEx?redirect=search.$phpEx&search_id=newposts", true); redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=newposts", true));
exit;
} }
$show_results = 'topics'; $show_results = 'topics';
@ -180,8 +179,7 @@ else if ( $search_keywords != '' || $search_author != '' || $search_id )
} }
else else
{ {
header("Location: login.$phpEx?redirect=search.$phpEx&search_id=egosearch", true); redirect(append_sid("login.$phpEx?redirect=search.$phpEx&search_id=egosearch", true));
exit;
} }
$show_results = 'topics'; $show_results = 'topics';

View file

@ -37,9 +37,7 @@ if ( !defined('INSTALLING') )
if( defined("PHPBB_INSTALLED") ) if( defined("PHPBB_INSTALLED") )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; redirect("index.$phpEx);
header($header_location . " index.$phpEx");
exit;
} }
} }

View file

@ -103,9 +103,7 @@ if ( !$is_auth['auth_read'] || !$is_auth['auth_view'] )
if ( !$userdata['session_logged_in'] ) if ( !$userdata['session_logged_in'] )
{ {
$redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : '' ); $redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : '' );
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect(append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
header($header_location . append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true));
exit;
} }
// //
// The user is not authed to read this forum ... // The user is not authed to read this forum ...

View file

@ -58,8 +58,6 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
{ {
if ( $HTTP_GET_VARS['view'] == 'newest' ) if ( $HTTP_GET_VARS['view'] == 'newest' )
{ {
$header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: ';
if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) ) if ( isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) || isset($HTTP_GET_VARS['sid']) )
{ {
$session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid']; $session_id = isset($HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']) ? $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid'] : $HTTP_GET_VARS['sid'];
@ -88,14 +86,12 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) )
$post_id = $row['post_id']; $post_id = $row['post_id'];
$SID = (isset($HTTP_GET_VARS['sid'])) ? 'sid=' . $session_id : ''; $SID = (isset($HTTP_GET_VARS['sid'])) ? 'sid=' . $session_id : '';
header($header_location . append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true)); redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true));
exit;
} }
} }
$db->sql_close(); $db->sql_close();
header($header_location . append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true)); redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true));
exit;
} }
else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' ) else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )
{ {
@ -178,9 +174,7 @@ if( !$is_auth['auth_view'] || !$is_auth['auth_read'] )
{ {
$redirect = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id"; $redirect = ( isset($post_id) ) ? POST_POST_URL . "=$post_id" : POST_TOPIC_URL . "=$topic_id";
$redirect .= ( isset($start) ) ? "&start=$start" : ''; $redirect .= ( isset($start) ) ? "&start=$start" : '';
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&$redirect", true));
exit;
} }
$message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']); $message = ( !$is_auth['auth_view'] ) ? $lang['Topic_post_not_exist'] : sprintf($lang['Sorry_auth_read'], $is_auth['auth_read_type']);
@ -296,9 +290,7 @@ else
{ {
if ( $HTTP_GET_VARS['unwatch'] == 'topic' ) if ( $HTTP_GET_VARS['unwatch'] == 'topic' )
{ {
$header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; redirect(append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true));
header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true));
exit;
} }
} }
else else