Item8563: Short URLs not recognised as internal

pencil
Priority: Normal
Current State: Closed
Released In: n/a
Target Release: n/a
Applies To: Extension
Component: ExternalLinkPlugin
Branches: master
Reported By: MartinKaufmann
Waiting For:
Last Change By: GeorgeClark
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
 
I Attachment Action Size Date Who Comment
ExternalLinkPlugin.pm.patchpatch ExternalLinkPlugin.pm.patch manage 744 bytes 18 Feb 2010 - 10:19 MartinKaufmann Patch for ExternalLinkPlugin.pm
Topic revision: r3 - 02 Aug 2015, GeorgeClark
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