diff options
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; |