From b18915bb95c8b1fd9cf8ecef73f45cd47f71fc09 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Thu, 15 Mar 2018 22:30:48 -0400 Subject: add Bugzilla->urlbase method that returns a URI object --- Bugzilla.pm | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 3e969a99d..1ab72431a 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -59,6 +59,7 @@ use Safe; use Sys::Syslog qw(:DEFAULT); use List::Util qw(any); use JSON::XS qw(decode_json); +use URI; use parent qw(Bugzilla::CPAN); @@ -272,6 +273,13 @@ sub localconfig { return $_[0]->process_cache->{localconfig} ||= read_localconfig(); } +sub urlbase { + my ($class) = @_; + + # Since this could be modified, we have to return a new one every time. + return URI->new($class->localconfig->{urlbase}); +} + sub params { return $_[0]->request_cache->{params} ||= Bugzilla::Config::read_param_file(); } -- cgit v1.2.3-24-g4f1b