[FIX] Variables Passed In The Login Redirect »  Show posts from    to     

Icy Phoenix


Old Support Topics - [FIX] Variables Passed In The Login Redirect



FedericoBiccheddu [ Sat 15 Aug, 2009 10:59 ]
Post subject: [FIX] Variables Passed In The Login Redirect
Beacause I am a perfectionist ( ), 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: [Hide] [Select]
login_ip.php?redirect=page.php&var1=value1&var2=value2


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


to "correct", open /includes/page_header.php, search:
Code: [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: [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


Mighty Gorgon [ Wed 19 Aug, 2009 10:55 ]
Post 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.




Powered by Icy Phoenix