summaryrefslogtreecommitdiffstats
path: root/extensions/BzAPI
diff options
context:
space:
mode:
authorDylan William Hardison <dylan@hardison.net>2018-10-09 23:01:07 +0200
committerGitHub <noreply@github.com>2018-10-09 23:01:07 +0200
commit75dbfe1dc03748957f07eca5ac583bedc6fdba76 (patch)
tree692f90aa15f4e512581cf2cf06a9b240757aaaba /extensions/BzAPI
parent2ae37c378b50b1ae16c35ce74999b19eb91af07d (diff)
downloadbugzilla-75dbfe1dc03748957f07eca5ac583bedc6fdba76.tar.gz
bugzilla-75dbfe1dc03748957f07eca5ac583bedc6fdba76.tar.xz
Bug 623384 - Use Module::Runtime instead of eval { require } or eval "use"
Diffstat (limited to 'extensions/BzAPI')
-rw-r--r--extensions/BzAPI/Extension.pm4
1 files changed, 2 insertions, 2 deletions
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);