summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>2012-04-24 23:21:22 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-04-24 23:21:22 +0200
commit41beb175fdeffa2ac3598a714ac3acb985ba86a4 (patch)
treeb5ace690c1b9462aedd612bf8dcde426d48c855d
parent4862600fbf51d9f468f69e198f7e50648250235a (diff)
downloadbugzilla-41beb175fdeffa2ac3598a714ac3acb985ba86a4.tar.gz
bugzilla-41beb175fdeffa2ac3598a714ac3acb985ba86a4.tar.xz
Bug 645433: Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) doesn't change Bugzilla->error_mode
r/a=LpSolit
-rw-r--r--Bugzilla.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 621222e8a..ccd384067 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -445,8 +445,14 @@ sub error_mode {
if (defined $newval) {
$class->request_cache->{error_mode} = $newval;
}
- return $class->request_cache->{error_mode}
- || (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
+
+ # XXX - Once we require Perl 5.10.1, this test can be replaced by //.
+ if (exists $class->request_cache->{error_mode}) {
+ return $class->request_cache->{error_mode};
+ }
+ else {
+ return (i_am_cgi() ? ERROR_MODE_WEBPAGE : ERROR_MODE_DIE);
+ }
}
# This is used only by Bugzilla::Error to throw errors.