Skip to content

Commit

Permalink
Item14202: Bad logic in the link tracking check
Browse files Browse the repository at this point in the history
  • Loading branch information
gac410 committed Nov 11, 2016
1 parent 64a9660 commit 7c45a41
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions core/lib/Foswiki/PageCache.pm
Original file line number Diff line number Diff line change
Expand Up @@ -470,19 +470,18 @@ sub addTopicRef {

#Foswiki::Func::writeDebug( "addTopicRef $webRef.$topicRef\n" ) if TRACE;

if ( defined $Foswiki::cfg{Cache}{TrackInternalLinks} ) {

return if ( $Foswiki::cfg{Cache}{TrackInternalLinks} eq 'off' );

my $session = $Foswiki::Plugins::SESSION;
return
unless (
( $Foswiki::cfg{Cache}{TrackInternalLinks} eq 'authenticated' )
&& $session->inContext('authenticated') );
}
my $session = $Foswiki::Plugins::SESSION;

return $this->addDependency( $webRef, $topicRef );
return $this->addDependency( $webRef, $topicRef )
if ( !defined $Foswiki::cfg{Cache}{TrackInternalLinks}
|| ( $Foswiki::cfg{Cache}{TrackInternalLinks} eq 'on' )
|| ( $Foswiki::cfg{Cache}{TrackInternalLinks} eq 'authenticated' )
&& $session->inContext('authenticated') );

# If we reach here, either:
# - It is a guest session and TrackInternalLinks was set to authenticated
# - TrackInternalLinks is set to off (or some unexpected value.
return;
}

=begin TML
Expand Down

0 comments on commit 7c45a41

Please sign in to comment.