[FIX] Variables Passed In The Login Redirect


Subject: [FIX] Variables Passed In The Login Redirect
Beacause I am a perfectionist ( :mrblue: ), I wanted to report a "problem" and possible fix to this problem.

When we have not logged in the pages, thanks to Icy Phoenix variable {U_LOGIN_LOGOUT} allows us to be redirected to the page you were visiting.

It's probable that the address being passed several variables, are normally passed as follows:
Code: [Download] [Hide] [Select]
login_ip.php?redirect=page.php&var1=value1&var2=value2


but it should be so:
Code: [Download] [Hide] [Select]
login_ip.php?redirect=page.php?var1=value1&var2=value2


to "correct", open /includes/page_header.php, search:
Code: [Download] [Hide] [Select]
if(isset($_GET) && !empty($smart_redirect))
{
$smart_get_keys = array_keys($_GET);
for ($i = 0; $i < count($_GET); $i++)
{
if ($smart_get_keys[$i] != 'sid')
{
$smart_redirect .= '&amp;' . $smart_get_keys[$i] . '=' . urlencode(ip_utf8_decode($_GET[$smart_get_keys[$i]]));
}
}
}


Replace with:
Code: [Download] [Hide] [Select]
if(isset($_GET) && !empty($smart_redirect))
{
$smart_get_keys = array_keys($_GET);
for ($i = 0; $i < count($_GET); $i++)
{
if ($smart_get_keys[$i] != 'sid')
{
if ($i == 0)
{
$smart_redirect .= '?';
}
else
{
$smart_redirect .= '&amp;';
}
$smart_redirect .= $smart_get_keys[$i] . '=' . urlencode(ip_utf8_decode($_GET[$smart_get_keys[$i]]));
}
}


It 'a very small thing, but make more perfect our Icy :loveit:

Subject: Re: [FIX] Variables Passed In The Login Redirect
I don't think the current system is buggy...


? are converted into & because when redirecting you cannot have ? twice in address! So the first ? is converted into & and then converted again into ? when redirecting starts...

I have worked a lot about this issue... please check again.


Page 1 of 1


  
You cannot post new topics
You cannot reply to topics
You cannot edit your posts
You cannot delete your posts
You cannot vote in polls
You cannot attach files
You can download files
You cannot post calendar events

   

This is a "Lo-Fi" version of our main content. To view the full version with more information, formatting and images, please click here.

Powered by Icy Phoenix based on phpBB
Generation Time: 0.0627s (PHP: 25% SQL: 75%)
SQL queries: 10 - Debug Off - GZIP Enabled