diff options
| author | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-18 21:03:56 +0000 |
|---|---|---|
| committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-05-18 21:03:56 +0000 |
| commit | 3c02d5f2df00cecd6a0bc4a945ee3355bd423a81 (patch) | |
| tree | 0c2d02685fee117d7643e13e0aa4f9da1956000d /phpBB/includes/functions.php | |
| parent | 7e25c8d9cc255fbe460c2a970ad7da241c0880bb (diff) | |
| download | forums-3c02d5f2df00cecd6a0bc4a945ee3355bd423a81.tar forums-3c02d5f2df00cecd6a0bc4a945ee3355bd423a81.tar.gz forums-3c02d5f2df00cecd6a0bc4a945ee3355bd423a81.tar.bz2 forums-3c02d5f2df00cecd6a0bc4a945ee3355bd423a81.tar.xz forums-3c02d5f2df00cecd6a0bc4a945ee3355bd423a81.zip | |
- 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
Diffstat (limited to 'phpBB/includes/functions.php')
| -rw-r--r-- | phpBB/includes/functions.php | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/phpBB/includes/functions.php b/phpBB/includes/functions.php index a63318e35f..dc435b4814 100644 --- a/phpBB/includes/functions.php +++ b/phpBB/includes/functions.php @@ -1230,6 +1230,27 @@ function redirect($url) } /** +* 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 */ function build_url($strip_vars = false) @@ -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); |
