summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
authormkanat%bugzilla.org <>2007-07-31 08:08:16 +0200
committermkanat%bugzilla.org <>2007-07-31 08:08:16 +0200
commit9b28d0fded7754d3399f895abe16a90c4d451946 (patch)
tree86d57f0760b9b744b7afcd0babed2b381c12bcae /Bugzilla.pm
parentf58650e43e01119d30be25befd275f4d4f380a97 (diff)
downloadbugzilla-9b28d0fded7754d3399f895abe16a90c4d451946.tar.gz
bugzilla-9b28d0fded7754d3399f895abe16a90c4d451946.tar.xz
Bug 390148: Prevent Bugzilla from throwing warnings if we're on IIS
Patch By Max Kanat-Alexander <mkanat@bugzilla.org> r=glob, a=mkanat
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm14
1 files changed, 14 insertions, 0 deletions
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.