1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-08 01:36:57 +02:00

- fixing a few tiny bugs

- added new function to (re)apply sids where needed (login and mcp quickmod) - #1829


git-svn-id: file:///svn/phpbb/trunk@5931 89ea8834-ac86-4346-8a33-228a782c2dd0
This commit is contained in:
Meik Sievertsen
2006-05-18 21:03:56 +00:00
parent 7e25c8d9cc
commit 3c02d5f2df
13 changed files with 220 additions and 388 deletions

View File

@@ -1229,6 +1229,27 @@ function redirect($url)
exit;
}
/**
* Re-Apply $SID after page reloads
*/
function reapply_sid($url)
{
global $SID, $phpEx;
if ($url === "index.$phpEx")
{
return "index.$phpEx$SID";
}
// Remove previously added sid
if (strpos($url, '?sid='))
{
$url = preg_replace('/\?sid=[a-z0-9]+(&|&)?/', $SID . '\1', $url);
}
return (strpos($url, '?') === false) ? $url . $SID : $url . str_replace('?', '&', $SID);
}
/**
* Returns url from the session/current page with an re-appended SID with optionally stripping vars from the url
*/
@@ -1344,7 +1365,7 @@ function confirm_box($check, $title = '', $hidden = '', $html_body = 'confirm_bo
$s_hidden_fields = build_hidden_fields(array(
'user_id' => $user->data['user_id'],
'sess' => $user->session_id,
'sid' => $SID)
'sid' => $user->session_id)
);
// generate activation key
@@ -1463,22 +1484,7 @@ function login_box($redirect = '', $l_explain = '', $l_success = '', $admin = fa
$l_redirect = ($admin) ? $user->lang['PROCEED_TO_ACP'] : (($redirect === "index.$phpEx") ? $user->lang['RETURN_INDEX'] : $user->lang['RETURN_PAGE']);
// append/replace SID (may change during the session for AOL users)
if ($redirect === "index.$phpEx")
{
$redirect = "index.$phpEx$SID";
}
else
{
// Remove previously added sid (should not happen)
if (strpos($redirect, '?sid='))
{
$redirect = preg_replace('/\?sid=[a-z0-9]+(&|&)?/', $SID . '\1', $redirect);
}
else
{
$redirect = (strpos($redirect, '?') === false) ? $redirect . $SID : $redirect . str_replace('?', '&', $SID);
}
}
$redirect = reapply_sid($redirect);
meta_refresh(3, $redirect);
trigger_error($message . '<br /><br />' . sprintf($l_redirect, '<a href="' . $redirect . '">', '</a>'));
@@ -1880,9 +1886,6 @@ function censor_text($text)
{
$censors = array();
/**
* @todo For ANONYMOUS censoring should be enabled by default
*/
if ($user->optionget('viewcensors'))
{
$cache->obtain_word_list($censors);