mirror of
https://github.com/phpbb/phpbb.git
synced 2025-05-06 07:35:29 +02:00
Redirect and SID updates ... add SID by default to all new sessions as they are created
git-svn-id: file:///svn/phpbb/branches/phpBB-2_0_0@3203 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
parent
eda0907757
commit
f78e9d03b7
@ -699,7 +699,7 @@ function redirect($url)
|
||||
$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));
|
||||
$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
|
||||
@ -712,6 +712,7 @@ function redirect($url)
|
||||
{
|
||||
header('HTTP/1.0 302 Redirect');
|
||||
}
|
||||
|
||||
header('Location: ' . $server_protocol . $server_name . $script_name . $server_port . $url);
|
||||
exit;
|
||||
}
|
||||
|
@ -182,7 +182,7 @@ function session_begin($user_id, $user_ip, $page_id, $auto_create = 0, $enable_a
|
||||
setcookie($cookiename . '_data', serialize($sessiondata), $current_time + 31536000, $cookiepath, $cookiedomain, $cookiesecure);
|
||||
setcookie($cookiename . '_sid', $session_id, 0, $cookiepath, $cookiedomain, $cookiesecure);
|
||||
|
||||
$SID = ($sessionmethod == SESSION_METHOD_GET || defined('IN_ADMIN')) ? 'sid=' . $session_id : '';
|
||||
$SID = 'sid=' . $session_id;
|
||||
|
||||
return $userdata;
|
||||
}
|
||||
@ -370,12 +370,12 @@ function append_sid($url, $non_html_amp = false)
|
||||
{
|
||||
global $SID;
|
||||
|
||||
if ( !empty($SID) && !eregi('sid=', $url) )
|
||||
if ( !empty($SID) && !preg_match('#sid=#', $url) )
|
||||
{
|
||||
$url .= ( ( strpos($url, '?') != false ) ? ( ( $non_html_amp ) ? '&' : '&' ) : '?' ) . $SID;
|
||||
}
|
||||
|
||||
return($url);
|
||||
return $url;
|
||||
}
|
||||
|
||||
?>
|
Loading…
x
Reference in New Issue
Block a user