vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17513: LJSUP-5987: handle 'fullversion' query s...

Committer: vsukhanov
LJSUP-5987: handle 'fullversion' query string param without redirect.
U   trunk/cgi-bin/Apache/WURFL.pm
Modified: trunk/cgi-bin/Apache/WURFL.pm
===================================================================
--- trunk/cgi-bin/Apache/WURFL.pm	2010-10-05 10:07:48 UTC (rev 17512)
+++ trunk/cgi-bin/Apache/WURFL.pm	2010-10-06 10:26:28 UTC (rev 17513)
@@ -149,11 +149,11 @@
     my $user_agent  = $opts{'user_agent'}   = LJ::Request->header_in('User-Agent');
 
     # If we get 'fullversion=' arg, set cookie and redirect without this arg.
-    if ($args =~ /fullversion=(\w+)/) {
-        $self->set_our_cookie($1); LJ::Request->send_cookies();
-        $args =~ s/fullversion=(\w+)//;
-        $args =~ s/&$//;
-        return $uri . ($args ? "?$args" : '');
+    if ($args =~ /fullversion=(yes|no)/) {
+        my $flag = $1;
+        $self->set_our_cookie($flag); 
+        LJ::Request->send_cookies();
+        return '' if $flag eq 'yes';
     }
 
     # If we get cookie 'fullversion=yes', don't redirect.

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