Item9722: Incorrect (absolute) links returned by Foswiki::Func::getCgiQuery->url( -absolute => 1)

pencil
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
Reported By: DanDascalescu
Waiting For:
Last Change By: KennethLavrsen
This bug affects, among others, TablePlugin, which will generate links for sortable column headers to have URLs missing the hostname, like:

http://view/Main/TablePluginTest?sortcol=0;table=1;up=0#sorted_table

instead of

http://example.com/view/Main/TablePluginTest?sortcol=0;table=1;up=0#sorted_table

The cause is in Foswiki::Request::url, which has the following piece of code:

    my $name =
      defined $Foswiki::cfg{ScriptUrlPaths}{ $this->action }
      ? $Foswiki::cfg{ScriptUrlPaths}{ $this->action }
      : $Foswiki::cfg{ScriptUrlPath} . '/' . $this->action;

If $Foswiki::cfg{ScriptUrlPaths} isn't defined, and $Foswiki::cfg{ScriptUrlPath} is / (the usual case), $name will end up starting with two slashes, which makes it look like an absolute URL down the path, and the actual hostname will not be prepended.

-- DanDascalescu - 20 Sep 2010

Remember Release01x01 branch

-- KennethLavrsen - 20 Sep 2010

Could not wait for Dan. I assumed it was OK to merge to Release01x01 so I did.

Closing this. I assume this was not in 1.0.X so closing.

-- KennethLavrsen - 26 Sep 2010

 

ItemTemplate edit

Summary Incorrect (absolute) links returned by Foswiki::Func::getCgiQuery->url( -absolute => 1)
ReportedBy DanDascalescu
Codebase trunk
SVN Range
AppliesTo Engine
Component
Priority Urgent
CurrentState Closed
WaitingFor
Checkins distro:c8c421793412 distro:84e539870661
TargetRelease minor
ReleasedIn 1.1.0
Topic revision: r4 - 26 Sep 2010, KennethLavrsen
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