From 75dbfe1dc03748957f07eca5ac583bedc6fdba76 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Tue, 9 Oct 2018 17:01:07 -0400 Subject: Bug 623384 - Use Module::Runtime instead of eval { require } or eval "use" --- extensions/BzAPI/Extension.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extensions/BzAPI/Extension.pm') diff --git a/extensions/BzAPI/Extension.pm b/extensions/BzAPI/Extension.pm index bb9805134..d812a01c4 100644 --- a/extensions/BzAPI/Extension.pm +++ b/extensions/BzAPI/Extension.pm @@ -21,6 +21,7 @@ use Bugzilla::Util qw(trick_taint datetime_from); use Bugzilla::Constants; use Bugzilla::Install::Filesystem; use Bugzilla::WebService::Constants; +use Module::Runtime qw(require_module); use File::Basename; @@ -270,8 +271,7 @@ sub _preload_handlers { foreach my $module (_resource_modules()) { my $resource_class = "Bugzilla::Extension::BzAPI::Resources::$module"; trick_taint($resource_class); - eval("require $resource_class"); - warn $@ if $@; + eval { require_module($resource_class) }; next if ($@ || !$resource_class->can('rest_handlers')); my $handlers = $resource_class->rest_handlers; next if (ref $handlers ne 'ARRAY' || scalar @$handlers % 2 != 0); -- cgit v1.2.3-24-g4f1b