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
 
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