slartyblartfast (slartyblartfast) wrote in changelog,
slartyblartfast
slartyblartfast
changelog

[livejournal] r17152: LJSUP-5987: Redirection to mobile versio...

Committer: mchernyshev
LJSUP-5987: Redirection to mobile version
- added alternative to wurfl.
U   trunk/cgi-bin/Apache/WURFL.pm
Modified: trunk/cgi-bin/Apache/WURFL.pm
===================================================================
--- trunk/cgi-bin/Apache/WURFL.pm	2010-08-18 08:25:24 UTC (rev 17151)
+++ trunk/cgi-bin/Apache/WURFL.pm	2010-08-19 02:14:17 UTC (rev 17152)
@@ -9,6 +9,13 @@
     my $class = shift;
     my $user_agent = shift;
 
+    if ($LJ::WURFL{'ua_keys_mobile'}) {
+        foreach my $key (@{$LJ::WURFL{'ua_keys_mobile'}}) {
+            return 1 if $user_agent =~ /\Q$key\E/i;
+        }
+        return 0;
+    }
+
     unless ($wurfl) {
         $wurfl = LJ::WURFL->new();
         unless ($wurfl->load($LJ::WURFL{'wireless_storage'})) {

Tags: livejournal, pm, slartyblartfast
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