From 334bead74bc9c5e819f14946726eaad40986d636 Mon Sep 17 00:00:00 2001 From: Dylan William Hardison Date: Sat, 16 Dec 2017 13:17:05 -0600 Subject: Bug 1403777 - Migrate urlbase from params to localconfig --- extensions/SiteMapIndex/Extension.pm | 8 ++++---- extensions/SiteMapIndex/lib/Util.pm | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'extensions/SiteMapIndex') diff --git a/extensions/SiteMapIndex/Extension.pm b/extensions/SiteMapIndex/Extension.pm index a3f093485..3d4342e0e 100644 --- a/extensions/SiteMapIndex/Extension.pm +++ b/extensions/SiteMapIndex/Extension.pm @@ -31,7 +31,7 @@ use base qw(Bugzilla::Extension); our $VERSION = '1.0'; use Bugzilla::Constants qw(bz_locations ON_WINDOWS); -use Bugzilla::Util qw(correct_urlbase get_text); +use Bugzilla::Util qw(get_text); use Bugzilla::Install::Filesystem; use Bugzilla::Extension::SiteMapIndex::Constants; @@ -80,7 +80,7 @@ sub page_before_template { sub install_before_final_checks { my ($self) = @_; - if (!correct_urlbase()) { + if (!Bugzilla->localconfig->{urlbase}) { print STDERR get_text('sitemap_no_urlbase'), "\n"; return; } @@ -89,7 +89,7 @@ sub install_before_final_checks { return; } - return if (correct_urlbase() ne 'https://bugzilla.mozilla.org/'); + return if (Bugzilla->localconfig->{urlbase} ne 'https://bugzilla.mozilla.org/'); } sub install_filesystem { @@ -126,7 +126,7 @@ EOT sub before_robots_txt { my ($self, $args) = @_; - $args->{vars}{SITEMAP_URL} = correct_urlbase() . SITEMAP_URL; + $args->{vars}{SITEMAP_URL} = Bugzilla->localconfig->{urlbase} . SITEMAP_URL; } __PACKAGE__->NAME; diff --git a/extensions/SiteMapIndex/lib/Util.pm b/extensions/SiteMapIndex/lib/Util.pm index 3548e5af5..4519461b4 100644 --- a/extensions/SiteMapIndex/lib/Util.pm +++ b/extensions/SiteMapIndex/lib/Util.pm @@ -34,7 +34,7 @@ our @EXPORT = qw( use Bugzilla::Extension::SiteMapIndex::Constants; -use Bugzilla::Util qw(correct_urlbase datetime_from url_quote); +use Bugzilla::Util qw(datetime_from url_quote); use Bugzilla::Constants qw(bz_locations); use Scalar::Util qw(blessed); @@ -144,7 +144,7 @@ END foreach my $filename (@$filelist) { $index_xml .= " - " . correct_urlbase() . "data/$extension_name/$filename + " . Bugzilla->localconfig->{urlbase} . "data/$extension_name/$filename $timestamp "; @@ -166,8 +166,8 @@ END sub _generate_sitemap_file { my ($extension_name, $filecount, $products, $bugs) = @_; - my $bug_url = correct_urlbase() . 'show_bug.cgi?id='; - my $product_url = correct_urlbase() . 'describecomponents.cgi?product='; + my $bug_url = Bugzilla->localconfig->{urlbase} . 'show_bug.cgi?id='; + my $product_url = Bugzilla->localconfig->{urlbase} . 'describecomponents.cgi?product='; my $sitemap_xml = < -- cgit v1.2.3-24-g4f1b