diff options
author | mkanat%bugzilla.org <> | 2007-07-31 06:11:11 +0000 |
---|---|---|
committer | mkanat%bugzilla.org <> | 2007-07-31 06:11:11 +0000 |
commit | 45b4999c570f6548a0fb905448bd42aadfa83d36 (patch) | |
tree | 9faa39be0ec5088f8838403a120f28bf2b6b590e | |
parent | Bug 390065: Improve whining's HTML validation - Patch by Vlad Dascalu <vladd@... (diff) | |
download | bugzilla-45b4999c570f6548a0fb905448bd42aadfa83d36.tar.gz bugzilla-45b4999c570f6548a0fb905448bd42aadfa83d36.tar.bz2 bugzilla-45b4999c570f6548a0fb905448bd42aadfa83d36.zip |
Bug 390148: Prevent Bugzilla from throwing warnings if we're on IIS
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=glob, a=mkanat
-rw-r--r-- | Bugzilla.pm | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm index 679695bf2..7be74b173 100644 --- a/Bugzilla.pm +++ b/Bugzilla.pm @@ -86,6 +86,20 @@ sub init_page { # PATH is undefined. $ENV{'PATH'} = ''; + # IIS prints out warnings to the webpage, so ignore them, or log them + # to a file if the file exists. + if ($ENV{SERVER_SOFTWARE} && $ENV{SERVER_SOFTWARE} =~ /microsoft-iis/i) { + $SIG{__WARN__} = sub { + my ($msg) = @_; + my $datadir = bz_locations()->{'datadir'}; + if (-w "$datadir/errorlog") { + my $warning_log = new IO::File(">>$datadir/errorlog"); + print $warning_log $msg; + $warning_log->close(); + } + }; + } + # If Bugzilla is shut down, do not allow anything to run, just display a # message to the user about the downtime and log out. Scripts listed in # SHUTDOWNHTML_EXEMPT are exempt from this message. |