X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Flib%2FRT%2FShredder%2FPlugin.pm;h=9ee2b93c1d8bcdf52ae18281edde025dffe65547;hb=31f3763747b82764bb019cfab5b2a2945fc9a99d;hp=34380689aec65674691c384fa56390fd7a666c37;hpb=24548f7cf666bac02335d0bc74f81251c7b4ab50;p=freeside.git diff --git a/rt/lib/RT/Shredder/Plugin.pm b/rt/lib/RT/Shredder/Plugin.pm index 34380689a..9ee2b93c1 100644 --- a/rt/lib/RT/Shredder/Plugin.pm +++ b/rt/lib/RT/Shredder/Plugin.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -64,7 +64,7 @@ RT::Shredder::Plugin - interface to access shredder plugins my %plugins = RT::Shredder::Plugin->List; # load plugin by name - my $plugin = new RT::Shredder::Plugin; + my $plugin = RT::Shredder::Plugin->new; my( $status, $msg ) = $plugin->LoadByName( 'Tickets' ); unless( $status ) { print STDERR "Couldn't load plugin 'Tickets': $msg\n"; @@ -72,7 +72,7 @@ RT::Shredder::Plugin - interface to access shredder plugins } # load plugin by preformatted string - my $plugin = new RT::Shredder::Plugin; + my $plugin = RT::Shredder::Plugin->new; my( $status, $msg ) = $plugin->LoadByString( 'Tickets=status,deleted' ); unless( $status ) { print STDERR "Couldn't load plugin: $msg\n"; @@ -167,6 +167,7 @@ sub LoadByName { my $self = shift; my $name = shift or return (0, "Name not specified"); + $name =~ /^\w+(::\w+)*$/ or return (0, "Invalid plugin name"); local $@; my $plugin = "RT::Shredder::Plugin::$name";