Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions Bugzilla.pm
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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();
}
Expand Down
2 changes: 1 addition & 1 deletion Bugzilla/CGI.pm
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ sub send_cookie {
}

# Add the default path and the domain in.
state $uri = URI->new( Bugzilla->localconfig->{urlbase} );
state $uri = Bugzilla->urlbase;
$paramhash{'-path'} = $uri->path;
# we don't set the domain.
$paramhash{'-secure'} = 1
Expand Down
2 changes: 1 addition & 1 deletion Bugzilla/Template.pm
Original file line number Diff line number Diff line change
Expand Up @@ -925,7 +925,7 @@ sub create {
'sudoer' => sub { return Bugzilla->sudoer; },

# Allow templates to access the "corect" URLBase value
'urlbase' => sub { return Bugzilla->localconfig->{urlbase}; },
'urlbase' => sub { Bugzilla->urlbase },

# Allow templates to access docs url with users' preferred language
'docs_urlbase' => sub {
Expand Down