SID-01846: RedirectPlugin loops infinitely when using the Jump Box
| Status: |
Answered |
TWiki version: |
5.0.2 |
Perl version: |
5.8.8 |
| Category: |
RedirectPlugin |
Server OS: |
Red Hat Linux |
Last update: |
10 years ago |
When using the Jump Box to jump to a redirecting topic the browser is directed back to the redirecting topic repeatedly.
If I have this:
IRedirectToSomeWhere
%REDIRECT{"SomeWhere"}%
And I use the Jump Box from any topic to IRedirectToSomeWhere I would expect to get the topic SomeWhere, instead, the browser is redirected to IRedirectToSomeWhere with an additional
redirectedfrom URL parameter.
--
Joshua Tharp - 2013-12-31
Discussion and Answer
Looking at the
RedirectPluginDev topic I found the pointer to removing the Jump Box's
topic parameter. This fixes the problem.
Original code (version: 26175, lines: 132-133):
my $q = "?redirectedfrom=$baseWeb.$baseTopic";
$q .= ";" . $queryString if $queryString;
Sidenote: shouldn't the semi-colon be an ampersand?
I'm only a Perl hack, so this is probably far from optimal, but I changed it this way:
my $q = "?redirectedfrom=$baseWeb.$baseTopic";
if ($queryString) {
$queryString =~ s/topic=[a-zA-Z_0-9]+//;
$q .= ";" . $queryString if $queryString;
}
--
Joshua Tharp - 2013-12-31
This problem was noticed when implementing the fix for
SID-01848.
--
Joshua Tharp - 2013-12-31
Thank you Joshua! I finally updated the
RedirectPlugin with your fix.
--
Peter Thoeny - 2015-12-03
If you answer a question - or someone answered one of your questions - please remember to edit the page and set the status to answered. The status selector is below the edit box.