Skip to content

Commit

Permalink
Item1632: support backporting better by making use of modern APIs con…
Browse files Browse the repository at this point in the history
…ditional

git-svn-id: http://svn.foswiki.org/trunk/PublishPlugin@3932 0b4bb1d4-4e5a-0410-9cc4-b2b747904278
  • Loading branch information
CrawfordCurrie authored and CrawfordCurrie committed May 18, 2009
1 parent 4ccb271 commit 4193b7b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/Foswiki/Plugins/PublishPlugin.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,13 @@ sub _publishControlCentre {

my $query = TWiki::Func::getCgiQuery();

# SMELL: check access to this interface!
unless ( Foswiki::Func::isAnAdmin() ) {
# Check access to this interface!
if ( defined &Foswiki::Func::isAnAdmin && !Foswiki::Func::isAnAdmin() ) {
return CGI::span( { class => 'twikiAlert' },
"Only admins can access the control interface" );
}
# Old code doesn't have isAnAdmin so will allow access to
# the control UI for everyone. Caveat emptor.

my $output = CGI::p(<<HERE);
<h1>Publishers Control Interface</h1>
Expand Down
4 changes: 4 additions & 0 deletions lib/Foswiki/Plugins/PublishPlugin/Publisher.pm
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,10 @@ sub _validateList {

sub _validateTopic {
my $v = shift;
unless (defined &Foswiki::Func::isValidTopicName) {
# Old code doesn't have this. Caveat emptor.
return Foswiki::Sandbox::untaintUnchecked($v);
}
if (Foswiki::Func::isValidTopicName($v, 1)) {
return Foswiki::Sandbox::untaintUnchecked($v);
}
Expand Down

0 comments on commit 4193b7b

Please sign in to comment.