Index: modules/adblockplusorg/files/adblockplus.org |
=================================================================== |
--- a/modules/adblockplusorg/files/adblockplus.org |
+++ b/modules/adblockplusorg/files/adblockplus.org |
@@ -16,20 +16,20 @@ |
set $preferredLang en; |
} |
- set $browser "firefox"; |
+ set $user_agent "firefox"; |
if ($http_user_agent ~ \bChrome/\d+) { |
- set $browser "chrome"; |
+ set $user_agent "chrome"; |
} |
if ($http_user_agent ~ \bPresto/\d+) { |
- set $browser "opera"; |
+ set $user_agent "opera"; |
} |
if ($http_user_agent ~ \bAndroid\s.*\bAppleWebKit/\d+) { |
- set $browser "android"; |
+ set $user_agent "android"; |
} |
if ($arg_a ~ ^(view|show)?$) { |
- rewrite ^/(index\.html)?$ /$preferredLang/$browser redirect; |
- rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$browser redirect; |
+ rewrite ^/(index\.html)?$ /$preferredLang/$user_agent redirect; |
+ rewrite ^/(\w\w(_\w\w)?)/?$ /$1/$user_agent redirect; |
} |
rewrite ^/(\w\w(_\w\w)?)/installation$ /$1/ permanent; |
@@ -43,6 +43,7 @@ |
} |
set $static_uri $uri; |
+ set $browser $user_agent; |
if ($uri ~ ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$) { |
set $static_uri "/$1/"; |
set $browser $3; |
@@ -56,10 +57,10 @@ |
} |
set $static "$static!$arg_a!$cookie_anwiki_anwsesscode"; |
if ($static ~ ^ok!(view|show)?!$) { |
- rewrite ^ /static$static_uri?browser=$browser last; |
+ rewrite ^ /static$static_uri?browser=$browser&user_agent=$user_agent last; |
} |
- rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$ /index.php?p=$1&browser=$3 last; |
+ rewrite ^/(\w\w(_\w\w)?)/(firefox|chrome|opera|android)/?$ /index.php?p=$1&browser=$3&user_agent=$user_agent last; |
rewrite ^/(.*) /index.php?p=$1 last; |
} |
@@ -75,7 +76,7 @@ |
charset utf-8; |
if ($arg_browser) { |
- set $browser_class ' class="$arg_browser"'; |
+ set $browser_class ' class="$arg_browser ua-$arg_user_agent"'; |
} |
sub_filter ' id="content"' ' id="content"$browser_class'; |
} |
@@ -85,7 +86,7 @@ |
client_max_body_size 8m; |
if ($arg_browser) { |
- set $browser_class ' class="$arg_browser"'; |
+ set $browser_class ' class="$arg_browser ua-$arg_user_agent"'; |
} |
sub_filter ' id="content"' ' id="content"$browser_class'; |