Advertisement
Guest User

Untitled

a guest
Jun 26th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.12 KB | None | 0 0
  1. diff --git a/wp-content/plugins/mobile-client-detection-plugin/mobile_client_detection.php b/wp-content/plugins/mobile-client-detection-plugin/mobile_client_detection.php
  2. index 1a207c8..d1e5d22 100644
  3. --- a/wp-content/plugins/mobile-client-detection-plugin/mobile_client_detection.php
  4. +++ b/wp-content/plugins/mobile-client-detection-plugin/mobile_client_detection.php
  5. @@ -81,7 +81,7 @@ function mcd_get_platform($general_output=false){
  6.         }
  7.        
  8.         $ua = trim(strtolower($_SERVER['HTTP_USER_AGENT']));
  9. -       $pattern = '/(android\s\d|blackberry|ip(hone|ad|od)|iemobile|webos|palm|symbian|kindle|windows|win64|wow64|macintosh|intel\smac\sos\sx|ppx\smac\sos\sx|googlebot|googlebot-
  10. +       $pattern = '/(android\s\d|android; tablet|android; mobile|blackberry|ip(hone|ad|od)|iemobile|webos|palm|symbian|kindle|windows|win64|wow64|macintosh|intel\smac\sos\sx|ppx\
  11.         if(preg_match($pattern,$ua,$matches)){$platform=$matches[0];}
  12.        
  13.         switch($platform){
  14. @@ -89,6 +89,7 @@ function mcd_get_platform($general_output=false){
  15.                 /* phones */
  16.                 case 'android 1':
  17.                 case 'android 2':
  18. +               case 'android; mobile':
  19.                 case 'blackberry':
  20.                 case 'iphone':
  21.                 case 'ipod':
  22. @@ -102,6 +103,7 @@ function mcd_get_platform($general_output=false){
  23.                
  24.                 /* tablets */
  25.                 case 'android 3':
  26. +               case 'android; tablet':
  27.                 case 'ipad':
  28.                 case 'kindle':
  29.                         if($general_output){$platform='tablet';}
  30. @@ -137,11 +139,13 @@ function mcd_get_platform($general_output=false){
  31.                
  32.                 case 'android 1':
  33.                 case 'android 2':
  34. +               case 'android; mobile':
  35.                         if(!$general_output){$platform='android-phone';}
  36.                         break;
  37.                
  38.                 /* mobile platforms */
  39.                 case 'android 3':
  40. +               case 'android; tablet':
  41.                         if(!$general_output){$platform='android-tablet';}
  42.                         break;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement