diff options
author | Dylan William Hardison <dylan@hardison.net> | 2018-07-23 17:25:43 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-23 17:25:43 +0200 |
commit | 345e686485e484e087ea58c988e4831209c39554 (patch) | |
tree | 6888ff14ec3d34cfe21d64d520421ba94918a25b /Bugzilla/Constants.pm | |
parent | e8c0dfe232ce1efe78f8dd7cf6b78c24b96786e8 (diff) | |
download | bugzilla-345e686485e484e087ea58c988e4831209c39554.tar.gz bugzilla-345e686485e484e087ea58c988e4831209c39554.tar.xz |
Bug 1476841 - Various code cleanups ahead of the Mojolicious patch
Diffstat (limited to 'Bugzilla/Constants.pm')
-rw-r--r-- | Bugzilla/Constants.pm | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 3aa7b0fa4..185a30390 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -15,6 +15,7 @@ use base qw(Exporter); # For bz_locations use File::Basename; +use Cwd qw(realpath); use Memoize; @Bugzilla::Constants::EXPORT = qw( @@ -644,12 +645,8 @@ sub _bz_locations { # directory under both mod_cgi and mod_perl. We call dirname twice # to get the name of the directory above the "Bugzilla/" directory. # - # Calling dirname twice like that won't work on VMS or AmigaOS - # but I doubt anybody runs Bugzilla on those. - # - # On mod_cgi this will be a relative path. On mod_perl it will be an - # absolute path. - my $libpath = dirname(dirname($INC{'Bugzilla/Constants.pm'})); + # Always use an absolute path, based on the location of this file. + my $libpath = realpath(dirname(dirname(__FILE__))); # We have to detaint $libpath, but we can't use Bugzilla::Util here. $libpath =~ /(.*)/; $libpath = $1; |