summaryrefslogtreecommitdiffstats
path: root/Bugzilla.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla.pm')
-rw-r--r--Bugzilla.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/Bugzilla.pm b/Bugzilla.pm
index 8928ff8b0..621222e8a 100644
--- a/Bugzilla.pm
+++ b/Bugzilla.pm
@@ -485,8 +485,14 @@ sub usage_mode {
}
$class->request_cache->{usage_mode} = $newval;
}
- return $class->request_cache->{usage_mode}
- || (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE);
+
+ # XXX - Once we require Perl 5.10.1, this test can be replaced by //.
+ if (exists $class->request_cache->{usage_mode}) {
+ return $class->request_cache->{usage_mode};
+ }
+ else {
+ return (i_am_cgi()? USAGE_MODE_BROWSER : USAGE_MODE_CMDLINE);
+ }
}
sub installation_mode {