diff options
| author | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2002-10-09 19:50:48 +0000 |
|---|---|---|
| committer | Ludovic Arnaud <ludovic_arnaud@users.sourceforge.net> | 2002-10-09 19:50:48 +0000 |
| commit | 369189806bf4bf85fe0409e6f66919ab4f4b70cd (patch) | |
| tree | 988680c7700c818b42e2170a9d7d887efa3c812b /phpBB/viewtopic.php | |
| parent | ac4b54ff4dea78aaeec015685b1c02a66449f1f1 (diff) | |
| download | forums-369189806bf4bf85fe0409e6f66919ab4f4b70cd.tar forums-369189806bf4bf85fe0409e6f66919ab4f4b70cd.tar.gz forums-369189806bf4bf85fe0409e6f66919ab4f4b70cd.tar.bz2 forums-369189806bf4bf85fe0409e6f66919ab4f4b70cd.tar.xz forums-369189806bf4bf85fe0409e6f66919ab4f4b70cd.zip | |
Added the redirect() function for nice and clean redirection.
git-svn-id: file:///svn/phpbb/trunk@2948 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/viewtopic.php')
| -rw-r--r-- | phpBB/viewtopic.php | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 125360ca00..b74ebe7b85 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -41,12 +41,10 @@ if ( empty($topic_id) && empty($post_id) ) // Find topic id if user requested a newer // or older topic // -if ( isset($_GET['view']) && empty($post_id) ) +if (isset($_GET['view']) && empty($post_id)) { if ( $_GET['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']) ) { $session_id = $HTTP_COOKIE_VARS[$board_config['cookie_name'] . '_sid']; @@ -70,13 +68,11 @@ if ( isset($_GET['view']) && empty($post_id) ) } $post_id = $row['post_id']; - header($header_location . 'viewtopic.' . $phpEx . '?sid=' . $session_id . '&p=' . $post_id . '#' . $post_id); - exit; + redirect("viewtopic.$phpEx$SID&p=$post_id#$post_id"); } } - header($header_location . 'index.' . $phpEx); - exit; + redirect("index.$phpEx$SID"); } else if ( $_GET['view'] == 'next' || $_GET['view'] == 'previous' ) { @@ -169,9 +165,7 @@ if ( !$auth->acl_get('f_read', $forum_id) ) { $redirect = ( isset($post_id) ) ? "p=$post_id" : "t=$topic_id"; $redirect .= ( isset($start) ) ? "&start=$start" : ''; - $header_location = ( @preg_match('/Microsoft|WebSTAR|Xitami/', getenv('SERVER_SOFTWARE')) ) ? 'Refresh: 0; URL=' : 'Location: '; - header($header_location . 'login.' . $phpEx . $SID . '&redirect=viewtopic.' . $phpEx . '&' . $redirect); - exit; + redirect('login.' . $phpEx . $SID . '&redirect=viewtopic.' . $phpEx . '&' . $redirect); } message_die(MESSAGE, $lang['Sorry_auth_read']); |
