Skip to content

Commit

Permalink
Item13579: FindElsewherePlugin no longer respects NOAUTOLINK
Browse files Browse the repository at this point in the history
  • Loading branch information
KennethLavrsen committed Jul 30, 2015
1 parent 31473db commit 3ebc037
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 7 deletions.
3 changes: 2 additions & 1 deletion data/System/FindElsewherePlugin.txt
Expand Up @@ -136,7 +136,8 @@ $Foswiki::cfg{NameFilter} = $Foswiki::cfg{NameFilter} = '[\/\\s\\*?~^\\$@%`"\'&;
| Change History: | <!-- versions below in reverse order -->&nbsp; |
| Version: | %$VERSION% |
| Release: | %$RELEASE% |
| 19 Apr 2012: | (v2.4) Foswikitask:Item11778: FindElsewherePlugin breaks other plugins, prevents jquery.json.js from loading. |
| 29 Jul 2015: | (v2.5) Foswiki:Main.KennethLavrsen - Foswikitask:Item13579: Plugin now again respects NOAUTOLINK |
| 19 Apr 2012: | (v2.4) Foswikitask:Item11778: FindElsewherePlugin breaks other plugins, prevents jquery.json.js from loading. |
| 26 Mar 2012: | (v2.3) Foswiki:Main.SvenDowideit - Foswikitask:Item11695: add pre-Dakar linking |
| 16 Nov 2011: | (v2.2) Foswiki:Main.GeorgeClark - Foswikitask:Item10460 - expand macros in web list, Foswikitask:Item11199 - Don't autolink wikiwords that are part of an email address. Added unit tests and addressed possible reusability issues under fastcgi or mod_perl. Replace deprecated =startRenderingHandler= with =preRenderingHandler=. |
| 10 Jun 2010: | (v2.1) Foswiki:Main.CrawfordCurrie - major tidy-up, including removal of NOAUTOLINK no-op |
Expand Down
2 changes: 1 addition & 1 deletion lib/Foswiki/Plugins/FindElsewherePlugin.pm
Expand Up @@ -8,7 +8,7 @@ use warnings;

our $NO_PREFS_IN_TOPIC = 1;
our $VERSION = '$Rev$';
our $RELEASE = '2.4';
our $RELEASE = '2.5';
our $SHORTDESCRIPTION =
"Automatically link to another web(s) if a topic isn't found in the current web.";

Expand Down
9 changes: 8 additions & 1 deletion lib/Foswiki/Plugins/FindElsewherePlugin/Core.pm
Expand Up @@ -23,6 +23,7 @@ my $redirectable;
my @webList;
my $singleMixedAlphaNumRegex;
my $otherWebs;
my $noAutolink;

my $EMESC = "\1";

Expand All @@ -31,7 +32,7 @@ sub initPlugin {
# initPlugin($topic, $web, $user) -> $boolean

$thisWeb = $_[1];

$otherWebs = Foswiki::Func::getPreferencesValue("LOOKELSEWHEREWEBS");
unless ( defined($otherWebs) ) {

Expand Down Expand Up @@ -70,6 +71,8 @@ sub initPlugin {
$redirectable = Foswiki::Func::getPreferencesFlag("LOOKELSEWHEREFORLOCAL");

$singleMixedAlphaNumRegex = qr/[$Foswiki::regex{mixedAlphaNum}]/;

$noAutolink = Foswiki::Func::getPreferencesFlag('NOAUTOLINK');

}

Expand All @@ -82,6 +85,10 @@ sub preRenderingHandler {
$otherWebs = Foswiki::Func::expandCommonVariables($otherWebs);
}

if ( $noAutolink ) {
return;
}

foreach my $otherWeb ( split( /[,\s]+/, $otherWebs ) ) {
$otherWeb = Foswiki::Sandbox::untaint( $otherWeb,
\&Foswiki::Sandbox::validateWebName );
Expand Down
8 changes: 4 additions & 4 deletions lib/Foswiki/Plugins/FindElsewherePlugin/MANIFEST
@@ -1,4 +1,4 @@
data/System/FindElsewherePlugin.txt 0440
lib/Foswiki/Plugins/FindElsewherePlugin.pm 0440
lib/Foswiki/Plugins/FindElsewherePlugin/Core.pm 0440
lib/Foswiki/Plugins/FindElsewherePlugin/Config.spec 0440
data/System/FindElsewherePlugin.txt 0644
lib/Foswiki/Plugins/FindElsewherePlugin.pm 0644
lib/Foswiki/Plugins/FindElsewherePlugin/Core.pm 0644
lib/Foswiki/Plugins/FindElsewherePlugin/Config.spec 0644

0 comments on commit 3ebc037

Please sign in to comment.