summaryrefslogtreecommitdiffstats
path: root/Bugzilla/BugUrl.pm
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 /Bugzilla/BugUrl.pm
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 'Bugzilla/BugUrl.pm')
-rw-r--r--Bugzilla/BugUrl.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/Bugzilla/BugUrl.pm b/Bugzilla/BugUrl.pm
index 4724ae71a..a824d286d 100644
--- a/Bugzilla/BugUrl.pm
+++ b/Bugzilla/BugUrl.pm
@@ -16,6 +16,7 @@ use base qw(Bugzilla::Object);
use Bugzilla::Util;
use Bugzilla::Error;
use Bugzilla::Constants;
+use Module::Runtime qw(require_module);
use URI::QueryParam;
@@ -113,7 +114,7 @@ sub _do_list_select {
my $objects = $class->SUPER::_do_list_select(@_);
foreach my $object (@$objects) {
- eval "use " . $object->class; die $@ if $@;
+ require_module($object->class);
bless $object, $object->class;
}
@@ -133,8 +134,7 @@ sub class_for {
my $uri = URI->new($value);
foreach my $subclass ($class->SUB_CLASSES) {
- eval "use $subclass";
- die $@ if $@;
+ require_module($subclass);
return wantarray ? ($subclass, $uri) : $subclass
if $subclass->should_handle($uri);
}
@@ -145,7 +145,7 @@ sub class_for {
sub _check_class {
my ($class, $subclass) = @_;
- eval "use $subclass"; die $@ if $@;
+ require_module($subclass);
return $subclass;
}