Returns a string for use as an URL of the current wiki, e.g.
returns:
Is this deliberate or an oversight?
I would like to be able to force wiki to generate the link
which works fine when typed into either Linux Netscape or Konqueror. But it delivers back all the links as
http://xxxx/xxxx/index.cgi?PageName
because the sub looks at $ScriptName rather than $FullUrl.
Alternatively, is there any reason not to set $ScriptName from the tail of $FullUrl when given? That way $ScriptLink automatically gives relative links (as at present) but with the script as given by the config setting. Suggested code, at around line 312 of wiki.pl
sub InitRequest { my @ScriptPath = split('/', "$ENV{SCRIPT_NAME}"); $CGI::POST_MAX = $MaxPost; $CGI::DISABLE_UPLOADS = 1; # no uploads $q = new CGI; $Now = time; # Reset in case script is persistent $ScriptName = pop(@ScriptPath); # Name used in links $ScriptName = $1 if ( $FullUrl =~ ?.*/(.*)? ); ###### new line $IndexInit = 0; # Must be reset for each request $InterSiteInit = 0;
This correctly produces relative links starting with a "?" when the given $FullUrl ends with a "/". They work in Netscape and Konqueror.
--RiVer
Relative links may be difficult if one uses rewrite rules. Then it might be easier to set $FullUrl in the config file and set $ScriptName to $FullUrl in the script:
$Now = time; # Reset in case script is persistent $ScriptName = pop(@ScriptPath); # Name used in links $ScriptName = $FullUrl if ($FullUrl ne ''); ## added $IndexInit = 0; # Must be reset for each request $InterSiteInit = 0;