diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2013-11-13 16:14:54 +0100 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2013-11-13 16:14:54 +0100 |
commit | 784352d88b2f729531ed97ef392530199ef7fcfe (patch) | |
tree | 016c8dd0fa262cd6a1191befe88d238cdd4bddad /Bugzilla | |
parent | ba995704cdcf193df2da53a2212e8dff7e8b23e7 (diff) | |
download | bugzilla-784352d88b2f729531ed97ef392530199ef7fcfe.tar.gz bugzilla-784352d88b2f729531ed97ef392530199ef7fcfe.tar.xz |
Bug 843457: PROJECT environment variable is not honored when mod_perl is enabled
r/a=glob
Diffstat (limited to 'Bugzilla')
-rw-r--r-- | Bugzilla/Constants.pm | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Bugzilla/Constants.pm b/Bugzilla/Constants.pm index 9fa0c6818..60c7a34e0 100644 --- a/Bugzilla/Constants.pm +++ b/Bugzilla/Constants.pm @@ -608,6 +608,13 @@ use constant AUDIT_CREATE => '__create__'; use constant AUDIT_REMOVE => '__remove__'; sub bz_locations { + # Force memoize() to re-compute data per project, to avoid + # sharing the same data across different installations. + return _bz_locations($ENV{'PROJECT'}); +} + +sub _bz_locations { + my $project = shift; # We know that Bugzilla/Constants.pm must be in %INC at this point. # So the only question is, what's the name of the directory # above it? This is the most reliable way to get our current working @@ -624,12 +631,13 @@ sub bz_locations { $libpath =~ /(.*)/; $libpath = $1; - my ($project, $localconfig, $datadir); - if ($ENV{'PROJECT'} && $ENV{'PROJECT'} =~ /^(\w+)$/) { + my ($localconfig, $datadir); + if ($project && $project =~ /^(\w+)$/) { $project = $1; $localconfig = "localconfig.$project"; $datadir = "data/$project"; } else { + $project = undef; $localconfig = "localconfig"; $datadir = "data"; } @@ -664,7 +672,7 @@ sub bz_locations { # This makes us not re-compute all the bz_locations data every time it's # called. -BEGIN { memoize('bz_locations') }; +BEGIN { memoize('_bz_locations') }; 1; @@ -676,4 +684,6 @@ BEGIN { memoize('bz_locations') }; =item contenttypes +=item bz_locations + =back |