Commit 9b28d0fd authored by mkanat%bugzilla.org's avatar mkanat%bugzilla.org

Bug 390148: Prevent Bugzilla from throwing warnings if we're on IIS

Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=glob, a=mkanat
parent f58650e4
...@@ -86,6 +86,20 @@ sub init_page { ...@@ -86,6 +86,20 @@ sub init_page {
# PATH is undefined. # PATH is undefined.
$ENV{'PATH'} = ''; $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 # 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 # message to the user about the downtime and log out. Scripts listed in
# SHUTDOWNHTML_EXEMPT are exempt from this message. # SHUTDOWNHTML_EXEMPT are exempt from this message.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment