From 9b28d0fded7754d3399f895abe16a90c4d451946 Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 31 Jul 2007 06:08:16 +0000 Subject: Bug 390148: Prevent Bugzilla from throwing warnings if we're on IIS Patch By Max Kanat-Alexander r=glob, a=mkanat --- Bugzilla.pm | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'Bugzilla.pm') diff --git a/Bugzilla.pm b/Bugzilla.pm index 302a4c0ee..e4947fbe1 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. -- cgit v1.2.3-24-g4f1b