summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Template.pm
diff options
context:
space:
mode:
Diffstat (limited to 'Bugzilla/Template.pm')
-rw-r--r--Bugzilla/Template.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/Bugzilla/Template.pm b/Bugzilla/Template.pm
index bc0d77084..b03698477 100644
--- a/Bugzilla/Template.pm
+++ b/Bugzilla/Template.pm
@@ -1117,6 +1117,11 @@ sub create {
return \@optional;
},
'default_authorizer' => sub { return Bugzilla::Auth->new() },
+
+ # It is almost always better to do mobile feature detection, client side in js.
+ # However, we need to set the meta[name=viewport] server-side or the behavior is
+ # not as predictable. It is possible other parts of the frontend may use this feature too.
+ 'is_mobile_browser' => sub { return Bugzilla->cgi->user_agent =~ /Mobi/ },
},
};
# Use a per-process provider to cache compiled templates in memory across