summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Install/Localconfig.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Install/Localconfig.pm')
-rw-r--r--Bugzilla/Install/Localconfig.pm22
1 files changed, 11 insertions, 11 deletions
diff --git a/Bugzilla/Install/Localconfig.pm b/Bugzilla/Install/Localconfig.pm
index ac21a0cb7..6650eca27 100644
--- a/Bugzilla/Install/Localconfig.pm
+++ b/Bugzilla/Install/Localconfig.pm
@@ -164,6 +164,10 @@ use constant LOCALCONFIG_VARS => (
default => _migrate_param( "urlbase", "" ),
},
{
+ name => 'canonical_urlbase',
+ default => '',
+ },
+ {
name => 'attachment_base',
default => _migrate_param( "attachment_base", '' ),
},
@@ -294,18 +298,14 @@ sub _read_localconfig_from_file {
sub read_localconfig {
my ($include_deprecated) = @_;
+ my $config = $ENV{LOCALCONFIG_ENV}
+ ? _read_localconfig_from_env()
+ : _read_localconfig_from_file($include_deprecated);
- if ($ENV{LOCALCONFIG_ENV}) {
- my $lc = _read_localconfig_from_env();
- if ( $lc->{urlbase} eq 'AUTOMATIC' ) {
- $lc->{urlbase} = sprintf 'http://%s:%d/%s', hostname(), $ENV{PORT}, $ENV{BZ_QA_LEGACY_MODE} ? 'bmo/' : '';
- $ENV{BZ_BASE_URL} = sprintf 'http://%s:%d', hostname(), $ENV{PORT};
- }
- return $lc;
- }
- else {
- return _read_localconfig_from_file($include_deprecated);
- }
+ # Use the site's URL as the default Canonical URL
+ $config->{canonical_urlbase} //= $config->{urlbase};
+
+ return $config;
}
#