From bc19f61c0c33e71a00dcc8e4ca3e791a9e3b661d Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Wed, 18 Nov 2009 07:01:40 +0000 Subject: Fix for Bug 527505: Make t/001compile.t work even after Bugzilla::Install::CPAN messes with @INC, and make Bugzilla->feature work during mod_perl.pl. Patch by Max Kanat-Alexander r=LpSolit, a=mkanat --- mod_perl.pl | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) mode change 100644 => 100755 mod_perl.pl (limited to 'mod_perl.pl') diff --git a/mod_perl.pl b/mod_perl.pl old mode 100644 new mode 100755 index 1e5c7fc63..8ca691f9c --- a/mod_perl.pl +++ b/mod_perl.pl @@ -34,12 +34,14 @@ use ModPerl::RegistryLoader (); use CGI (); CGI->compile(qw(:cgi -no_xhtml -oldstyle_urls :private_tempfiles :unique_headers SERVER_PUSH :push)); +use File::Basename (); use Template::Config (); Template::Config->preload(); use Bugzilla (); use Bugzilla::Constants (); use Bugzilla::CGI (); +use Bugzilla::Install::Requirements (); use Bugzilla::Mailer (); use Bugzilla::Template (); use Bugzilla::Util (); @@ -75,9 +77,12 @@ my $rl = new ModPerl::RegistryLoader(); # If we try to do this in "new" it fails because it looks for a # Bugzilla/ModPerl/ResponseHandler.pm $rl->{package} = 'Bugzilla::ModPerl::ResponseHandler'; -# Note that $cgi_path will be wrong if somebody puts the libraries -# in a different place than the CGIs. +my $feature_files = Bugzilla::Install::Requirements::map_files_to_features(); foreach my $file (glob "$cgi_path/*.cgi") { + my $base_filename = File::Basename::basename($file); + if (my $feature = $feature_files->{$base_filename}) { + next if !Bugzilla->feature($feature); + } Bugzilla::Util::trick_taint($file); $rl->handler($file, $file); } -- cgit v1.2.3-65-gdbad