You are here: Foswiki>Tasks Web>Item13421 (12 Dec 2017, GeorgeClark)Edit Attach

Item13421: Jump to redirecting page creates infinite redirect-loop

pencil
Priority: Urgent
Current State: Confirmed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: RedirectPlugin
Branches:
Reported By: LieVen JohnRouillard
Waiting For:
Last Change By: GeorgeClark
When doing a "Jump" to a non-existing page, one is automatically lead to the message "Topic 'FooFam' does not exist".

When doing the same thing with an apostrophe in the word (like "Foo'Fam") then one is automatically lead to WebHome. (this is a minor bug, but nevermind)

BUT...
If WebHome has a redirect to a different page (e.g. "Welcome" or "Mainpage"), then the redirect goes into a never ending loop and creates an error message.

http://www.klingonwiki.net/bin/view/En/MainPage?redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&redirectedfrom=En.WebHome&topic=Foo%27Fam

To recreate the error go here: http://www.klingonwiki.net/En/FooFam and write something with an apostrophe in the box.

This error also happens with any redirecting page you jump to. Try jumping to TKD.

-- LieVen - 21 May 2015

The plugin already adds: redirectedfrom=$web.$topic

What if it were to append: &redirectedvia=$web.$topic to the url for every intermediate redirected page.

The plugin can then check to see if the current $web.$topic is already in one of the redirectedvia parameters? If so it stops redirecting, and generates and redirects to an oops page with: redirect loop listing redirectedfrom as the initial page and listing all the redirectedvia pages in the same order they are in the url).

Also the number of redirectedvia in the URL can be used to prevent large loops. Maybe limit the number of redirects to 5 or 10 (settable via config perhaps?).

Does this sound like a reasonable implementation mechanism?

-- JohnRouillard - 05 Jul 2015

Setting this to confirmed. I've seen redirect loops as well. But needs a developer to pick it up. Extension can be freely modified.

-- GeorgeClark - 12 Dec 2017

 

ItemTemplate edit

Summary Jump to redirecting page creates infinite redirect-loop
ReportedBy LieVen JohnRouillard
Codebase trunk
SVN Range
AppliesTo Extension
Component RedirectPlugin
Priority Urgent
CurrentState Confirmed
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn n/a
CheckinsOnBranches
trunkCheckins
masterCheckins
ItemBranchCheckins
Release02x01Checkins
Release02x00Checkins
Release01x01Checkins
Topic revision: r4 - 12 Dec 2017, GeorgeClark
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy