diff --git a/phpBB/admin/admin_styles.php b/phpBB/admin/admin_styles.php index 7b2522b7b2..d175bb2ef0 100644 --- a/phpBB/admin/admin_styles.php +++ b/phpBB/admin/admin_styles.php @@ -52,7 +52,9 @@ if( empty($HTTP_POST_VARS['send_file']) ) if( $cancel ) { - header("Location: " . append_sid("admin_styles.$phpEx")); + $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; + header($header_location . append_sid("admin_styles.$phpEx")); + exit; } if( isset($HTTP_GET_VARS['mode']) || isset($HTTP_POST_VARS['mode']) ) diff --git a/phpBB/admin/pagestart.php b/phpBB/admin/pagestart.php index 37e4d89091..db7133071f 100644 --- a/phpBB/admin/pagestart.php +++ b/phpBB/admin/pagestart.php @@ -39,7 +39,9 @@ init_userprefs($userdata); // if( !$userdata['session_logged_in'] ) { - header("Location: ../" . append_sid("login.$phpEx?redirect=admin/")); + $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; + header($header_location . '../' . append_sid("login.$phpEx?redirect=admin/")); + exit; } else if( $userdata['user_level'] != ADMIN ) { diff --git a/phpBB/common.php b/phpBB/common.php index fb2de73b9f..da2267ea79 100644 --- a/phpBB/common.php +++ b/phpBB/common.php @@ -101,18 +101,19 @@ if( !get_magic_quotes_gpc() ) // malicious rewriting of language and otherarray values via // URI params // -$board_config = Array(); -$userdata = Array(); -$theme = Array(); -$images = Array(); -$lang = Array(); +$board_config = array(); +$userdata = array(); +$theme = array(); +$images = array(); +$lang = array(); $gen_simple_header = FALSE; -@include($phpbb_root_path . 'config.'.$phpEx); +include($phpbb_root_path . 'config.'.$phpEx); if( !defined("PHPBB_INSTALLED") ) { header("Location: install.$phpEx"); + exit; } include($phpbb_root_path . 'includes/constants.'.$phpEx); diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php index df0109e346..54e5f0ff71 100644 --- a/phpBB/groupcp.php +++ b/phpBB/groupcp.php @@ -159,6 +159,7 @@ if ( isset($HTTP_POST_VARS['groupstatus']) && $group_id ) if ( !$userdata['session_logged_in'] ) { header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + exit; } $sql = "SELECT group_moderator @@ -208,6 +209,7 @@ else if ( isset($HTTP_POST_VARS['joingroup']) && $group_id ) if ( !$userdata['session_logged_in'] ) { header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + exit; } $sql = "SELECT ug.user_id, g.group_type @@ -309,10 +311,12 @@ else if ( isset($HTTP_POST_VARS['unsub']) || isset($HTTP_POST_VARS['unsubpending if ( $cancel ) { header($header_location . append_sid("groupcp.$phpEx", true)); + exit; } elseif ( !$userdata['session_logged_in'] ) { header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + exit; } if ( $confirm ) @@ -396,6 +400,7 @@ else if ( $group_id ) if ( !$userdata['session_logged_in'] ) { header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + exit; } } @@ -457,6 +462,7 @@ else if ( $group_id ) if ( !$userdata['session_logged_in'] ) { header($header_location . append_sid("login.$phpEx?redirect=groupcp.$phpEx&" . POST_GROUPS_URL . "=$group_id", true)); + exit; } if ( !$is_moderator ) diff --git a/phpBB/install.php b/phpBB/install.php index fc4a0e9e35..5cd46ef96f 100644 --- a/phpBB/install.php +++ b/phpBB/install.php @@ -344,6 +344,7 @@ else else { header("Location: " . append_sid("index.$phpEx", true)); + exit; } } diff --git a/phpBB/login.php b/phpBB/login.php index c37c9954b9..2395e995a9 100644 --- a/phpBB/login.php +++ b/phpBB/login.php @@ -67,6 +67,7 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($ if( $row['user_level'] != ADMIN && $board_config['board_disable'] ) { header($header_location . append_sid("index.$phpEx", true)); + exit; } else { @@ -81,10 +82,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($ if( !empty($HTTP_POST_VARS['redirect']) ) { header($header_location . append_sid($HTTP_POST_VARS['redirect'], true)); + exit; } else { header($header_location . append_sid("index.$phpEx", true)); + exit; } } else @@ -129,10 +132,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($ if( !empty($HTTP_POST_VARS['redirect']) ) { header($header_location . append_sid($HTTP_POST_VARS['redirect'], true)); + exit; } else { header($header_location . append_sid("index.$phpEx", true)); + exit; } } else @@ -140,10 +145,12 @@ if( isset($HTTP_POST_VARS['login']) || isset($HTTP_GET_VARS['login']) || isset($ if( !empty($HTTP_POST_VARS['redirect']) ) { header($header_location . append_sid($HTTP_POST_VARS['redirect'], true)); + exit; } else { header($header_location . append_sid("index.$phpEx", true)); + exit; } } } @@ -224,6 +231,7 @@ else else { header($header_location . append_sid("index.$phpEx", true)); + exit; } } diff --git a/phpBB/modcp.php b/phpBB/modcp.php index f91868bcb2..8f6407d72e 100644 --- a/phpBB/modcp.php +++ b/phpBB/modcp.php @@ -174,6 +174,7 @@ if ( isset($HTTP_POST_VARS['cancel']) ) $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid($redirect, true)); + exit; } // diff --git a/phpBB/privmsg.php b/phpBB/privmsg.php index 5c3dd48e15..70d87c1ed4 100644 --- a/phpBB/privmsg.php +++ b/phpBB/privmsg.php @@ -184,6 +184,7 @@ else if ( $mode == 'read' ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode&" . POST_POST_URL . "=$privmsgs_id", true)); + exit; } // @@ -245,6 +246,7 @@ else if ( $mode == 'read' ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); + exit; } $privmsg_id = $privmsg['privmsgs_id']; @@ -627,6 +629,7 @@ else if ( ( $delete && $mark_list ) || $delete_all ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); + exit; } if ( isset($mark_list) && !is_array($mark_list) ) { @@ -825,6 +828,7 @@ else if ( $save && $mark_list && $folder != 'savebox' && $folder != 'outbox' ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); + exit; } // @@ -914,6 +918,7 @@ else if ( $submit || $refresh || $mode != '' ) $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: '; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=$folder&mode=$mode" . $user_id, true)); + exit; } // @@ -1263,6 +1268,7 @@ else if ( $submit || $refresh || $mode != '' ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); + exit; } $privmsg_subject = $privmsg['privmsgs_subject']; @@ -1302,6 +1308,7 @@ else if ( $submit || $refresh || $mode != '' ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("privmsg.$phpEx?folder=$folder", true)); + exit; } $privmsg_subject = ( ( !preg_match('/^Re:/', $privmsg['privmsgs_subject']) ) ? 'Re: ' : '' ) . $privmsg['privmsgs_subject']; @@ -1633,6 +1640,7 @@ if ( !$userdata['session_logged_in'] ) { $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; header($header_location . append_sid("login.$phpEx?redirect=privmsg.$phpEx&folder=inbox", true)); + exit; } // diff --git a/phpBB/upgrade.php b/phpBB/upgrade.php index 762a400a60..2c25fe535f 100644 --- a/phpBB/upgrade.php +++ b/phpBB/upgrade.php @@ -37,7 +37,8 @@ if ( !defined('INSTALLING') ) if( defined("PHPBB_INSTALLED") ) { - header("Location: index.$phpEx"); + $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; + header($header_location . " index.$phpEx"); exit; } } diff --git a/phpBB/viewforum.php b/phpBB/viewforum.php index 2853aae29a..ae510c44f0 100644 --- a/phpBB/viewforum.php +++ b/phpBB/viewforum.php @@ -105,6 +105,7 @@ if ( !$is_auth['auth_read'] || !$is_auth['auth_view'] ) $redirect = POST_FORUM_URL . "=$forum_id" . ( ( isset($start) ) ? "&start=$start" : "" ); $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=viewforum.$phpEx&$redirect", true)); + exit; } // // The user is not authed to read this forum ... diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index f6dec6853b..f09649a272 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -182,6 +182,7 @@ if( !$is_auth['auth_view'] || !$is_auth['auth_read'] ) $redirect .= ( isset($start) ) ? "&start=$start" : ''; $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; 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']); @@ -299,6 +300,7 @@ else { $header_location = ( @preg_match("/Microsoft|WebSTAR|Xitami/", getenv("SERVER_SOFTWARE")) ) ? "Refresh: 0; URL=" : "Location: "; header($header_location . append_sid("login.$phpEx?redirect=viewtopic.$phpEx&" . POST_TOPIC_URL . "=$topic_id&unwatch=topic", true)); + exit; } } else