Skip to content

Commit

Permalink
+ A departure from SMF-based forums: redirectexit() will no longer ad…
Browse files Browse the repository at this point in the history
…d the session variable to the URL if it's already in a cookie. I'll be honest with you, I never noticed that variable before, but it's started showing up everywhere in my new server. If you know why, feel free to share! Other than that, this update is very logical, so for those like me who have the problem, there you go. (Subs.php)
  • Loading branch information
Nao committed Feb 11, 2017
1 parent 4584563 commit 213537f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/app/Subs.php
Expand Up @@ -1125,8 +1125,8 @@ function redirectexit($setLocation = '', $refresh = false, $permanent = false)
if ($is_internal = !preg_match('~^(?:http|ftp)s?://~', $setLocation))
$setLocation = SCRIPT . ($setLocation != '' ? '?' . $setLocation : '');

// Put the session ID in.
if (defined('SID') && SID != '')
// Put the session ID in, if it's not already in a cookie.
if (defined('SID') && SID != '' && (!isset($_COOKIE[session_name()]) || $_COOKIE[session_name()] !== session_id()))
$setLocation = preg_replace('/^' . preg_quote(SCRIPT, '/') . '(?!\?' . preg_quote(SID, '/') . ')\\??/', SCRIPT . '?' . SID . ';', $setLocation);
// Keep that debug in their for template debugging!
elseif (isset($_GET['debug']))
Expand Down

0 comments on commit 213537f

Please sign in to comment.