Item9722: Incorrect (absolute) links returned by Foswiki::Func::getCgiQuery->url( -absolute => 1)
Priority: Urgent
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
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