Whilst running TWIKI in IIS 7.5 I noticed that the origurl query string parameter was not being calculated correctly for returnable pages. The following result was returned from Request.pm -> url():
/twiki/tbin/login.pl/Main/WebHome?origurl=/twiki/tbin/view
Case:
- All of my perl scripts are mapped with a *.pl extension. so this url would result in a 404 when trying to return to /twiki/tbin/view
- When the Engine.pm routine prepares the $req->path $ENV{REQUEST_URI} is undefined as environment variables are not defined in IIS. Thus it fallsback to manually constructing the path via the LocalSite.cfg variables. See Request.pm -> url();
The problem is
Request.pm -> url() will only calculate using the fallback url using $TWiki::cfg{ScriptUrlPath} and $TWiki::cfg{ScriptUrlPaths}{ $this->action } and not include the $TWiki::cfg{ScriptSuffix}
I change twiki/data/Request.pm line the following to fix this occurrence :
my $name =
(defined $TWiki::cfg{ScriptUrlPaths}{ $this->action }
? $TWiki::cfg{ScriptUrlPaths}{ $this->action }
: $TWiki::cfg{ScriptUrlPath} . '/' . $this->action)
. $TWiki::cfg{ScriptSuffix};
- PERL is not my primary language. Please make me aware of any optimizations or mistakes
- This code is marked as not working for IIS. Though I believe my suggestion would fix it?
--
TWiki:Main/NolanSedley
- 2014-10-23
Thanks Nolan. Although this fix works for IIS, I have a hunch that it breaks on Linux. It needs to be debugged and tested.
--
TWiki:Main.PeterThoeny
- 2014-10-24
Of course. Let me know if I can be of any more assistance.
--
TWiki:Main.NolanSedley
- 2014-10-24