vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r21059: LJSUP-11106: iPad useragent

Committer: vsukhanov
LJSUP-11106: iPad useragent
U   trunk/cgi-bin/Apache/WURFL.pm
Modified: trunk/cgi-bin/Apache/WURFL.pm
===================================================================
--- trunk/cgi-bin/Apache/WURFL.pm	2012-02-01 10:46:20 UTC (rev 21058)
+++ trunk/cgi-bin/Apache/WURFL.pm	2012-02-01 10:57:53 UTC (rev 21059)
@@ -6,8 +6,8 @@
 my $wurfl;
 
 sub is_mobile {
-    my $class = shift;
-    my $user_agent = shift || LJ::Request->header_in('User-Agent');
+    my ($class, $user_agent) = @_;
+    $user_agent ||= LJ::Request->header_in('User-Agent');
 
     if ($LJ::WURFL{'ua_keys_mobile'}) {
         my @redir = grep { $user_agent =~ /\Q$_\E/i } @{$LJ::WURFL{'ua_keys_mobile'}};
@@ -25,6 +25,14 @@
     return $wurfl->is_mobile($user_agent);
 }
 
+sub is_gsensor {
+    my ($class, $user_agent) = @_;
+    $user_agent ||= LJ::Request->header_in('User-Agent');
+
+    return ($user_agent =~ $LJ::GSENSOR_GADGETS_UA) ? 1 : 0;
+}
+
+
 my $mobile_domain = 'http://m.livejournal.com';
 
 sub _process_url_args {

Tags: livejournal, pm, vadvs, vsukhanov
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments