]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 645433: Bugzilla->error_mode( ERROR_MODE_WEBPAGE ) doesn't change Bugzilla->error...
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>
Tue, 24 Apr 2012 21:21:22 +0000 (23:21 +0200)
committerFrédéric Buclin <LpSolit@gmail.com>
Tue, 24 Apr 2012 21:21:22 +0000 (23:21 +0200)
r/a=LpSolit

Bugzilla.pm

index 621222e8ae1b521db9f3f239cdddb02ce76b683b..ccd38406740471e3dcd66cce46b575a6311dccd0 100644 (file)
@@ -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.