Item8563: Short URLs not recognised as internal
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
We are using short URLs (
http://wiki.local/Main/WebHome
instead of
http://wiki.local/bin/view/Main/WebHome
).
ExternalLinkPlugin (v1.21) recognises internal links of the form
[[%SCRIPTURLPATH{"view"}%/%BASEWEB%/%BASETOPIC%?limit=100][Latest 100 Changes]]
as external links.
ExternalLinkPlugin checks if the URL contains PUBURLPATH or SCRIPTURLPATH:
if ( ( $url =~ /^$scriptUrl/ )
|| ( $url =~ /^$pubUrl/ )
|| ( $wholeLink =~ /[&]nbsp;$/ ) )
{
return $wholeLink;
}
else {
return "<span class='externalLink'>$wholeLink</span>";
}
Why doesn't it just check for the hostname? I added the following line (see
patch):
if ( ( $url =~ /^$scriptUrl/ )
|| ( $url =~ /^$pubUrl/ )
|| ( $url =~ /^$urlHost/ )
|| ( $wholeLink =~ /[&]nbsp;$/ ) )
--
MartinKaufmann - 18 Feb 2010
Thanks for the patch. Applied with some minor changes.
--
GeorgeClark - 02 Aug 2015