Skip to content

Commit

Permalink
Item11808: perltidy them all, so people are not accidentally impacted…
Browse files Browse the repository at this point in the history
… by the new enforced rule -- Sorry Micha, could not find a way to define specific values within the file

git-svn-id: http://svn.foswiki.org/trunk/RedirectPlugin@14686 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
OlivierRaginel authored and OlivierRaginel committed May 4, 2012
1 parent f23aadb commit 6f2da02
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions lib/Foswiki/Plugins/RedirectPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ sub REDIRECT {
my $anchor = '';
my $queryString = '';
my $dest = $params->{'newtopic'} || $params->{_DEFAULT};
my $dontCheckDestinationExists = $params->{'dontcheck'} || 0;
my $dontCheckDestinationExists = $params->{'dontcheck'} || 0;

my $webNameRegex = Foswiki::Func::getRegularExpression('webNameRegex');
my $wikiWordRegex = Foswiki::Func::getRegularExpression('wikiWordRegex');
Expand Down Expand Up @@ -107,15 +107,16 @@ sub REDIRECT {

return "%BR% %RED% Cannot redirect to current topic %ENDCOLOR%"
if ( $topicLocation eq "$web.$topic" );
return "%BR% %RED% Cannot redirect to an already visited topic %ENDCOLOR%"
return
"%BR% %RED% Cannot redirect to an already visited topic %ENDCOLOR%"
if ( $queryString =~ /redirectedfrom=$topicLocation/ );

unless ($dontCheckDestinationExists) {
if ( !Foswiki::Func::topicExists( undef, $topicLocation ) ) {
return
"%RED% Could not redirect to topic $topicLocation (the topic does not seem to exist) %ENDCOLOR%";
}
}
unless ($dontCheckDestinationExists) {
if ( !Foswiki::Func::topicExists( undef, $topicLocation ) ) {
return
"%RED% Could not redirect to topic $topicLocation (the topic does not seem to exist) %ENDCOLOR%";
}
}

if ( $dest =~ /($anchorRegex)/ ) {
$anchor = $1;
Expand Down

0 comments on commit 6f2da02

Please sign in to comment.