From 88731651b04f79ae8674def65d4ea08b029acafd Mon Sep 17 00:00:00 2001 From: "Paul S. Owen" Date: Fri, 10 Jan 2003 13:27:35 +0000 Subject: [PATCH] Changes to add session_id to newest redirect were failing ... fixed git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3299 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/includes/functions.php | 9 +++++++-- phpBB/viewtopic.php | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index ce87e1a872..9fa00a815d 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -697,7 +697,12 @@ function phpbb_realpath($path) function redirect($url) { - global $board_config; + global $db, $board_config; + + if (!empty($db)) + { + $db->sql_close(); + } $server_protocol = ($board_config['cookie_secure']) ? 'https://' : 'http://'; $server_name = preg_replace('/^\/?(.*?)\/?$/', '\1', trim($board_config['server_name'])); @@ -718,4 +723,4 @@ function redirect($url) exit; } -?> +?> \ No newline at end of file diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index ffee96ecdd..9e37d7961c 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -82,15 +82,19 @@ if ( isset($HTTP_GET_VARS['view']) && empty($HTTP_GET_VARS[POST_POST_URL]) ) message_die(GENERAL_MESSAGE, 'No_new_posts_last_visit'); } - $db->sql_close(); $post_id = $row['post_id']; - $SID = (isset($HTTP_GET_VARS['sid'])) ? 'sid=' . $session_id : ''; - redirect(append_sid("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id", true)); + if (isset($HTTP_GET_VARS['sid'])) + { + redirect("viewtopic.$phpEx?sid=$session_id&" . POST_POST_URL . "=$post_id#$post_id"); + } + else + { + redirect("viewtopic.$phpEx?" . POST_POST_URL . "=$post_id#$post_id"); + } } } - $db->sql_close(); redirect(append_sid("viewtopic.$phpEx?" . POST_TOPIC_URL . "=$topic_id", true)); } else if ( $HTTP_GET_VARS['view'] == 'next' || $HTTP_GET_VARS['view'] == 'previous' )