summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKoosha Khajeh Moogahi <koosha.khajeh@gmail.com>2012-04-24 20:27:35 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2012-04-24 20:27:35 +0200
commit4862600fbf51d9f468f69e198f7e50648250235a (patch)
tree1b3097b3c302b713c99f752bb4825caecf46ab62
parentd550fa977239535afe8bca6acbf3251f5de04b57 (diff)
downloadbugzilla-4862600fbf51d9f468f69e198f7e50648250235a.tar.gz
bugzilla-4862600fbf51d9f468f69e198f7e50648250235a.tar.xz
Bug 645427: Bugzilla->usage_mode( USAGE_MODE_BROWSER ) doesn't change Bugzilla->usage_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 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 {