Esempio n. 1
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Sagem', 'SAGEM'));
 }
Esempio n. 2
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfContains($userAgent, 'Safari') && WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla/5.0 (Macintosh', 'Mozilla/5.0 (Windows'));
 }
Esempio n. 3
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Grundig', 'GRUNDIG'));
 }
Esempio n. 4
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Pantech', 'PT-', 'PANTECH', 'PG-'));
 }
Esempio n. 5
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('kyocera', 'QC-', 'KWC-'));
 }
Esempio n. 6
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Sanyo', 'SANYO')) || WURFL_Handlers_Utils::checkIfContains($userAgent, 'MobilePhone');
 }
Esempio n. 7
0
 public function normalize($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7')) || WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopModel($userAgent);
         $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneDesktopVersion($userAgent);
     } else {
         if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
             $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneAdClientModel($userAgent);
             $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
         } else {
             if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NativeHost')) {
                 return $userAgent;
             } else {
                 $model = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneModel($userAgent);
                 $version = WURFL_Handlers_WindowsPhoneHandler::getWindowsPhoneVersion($userAgent);
             }
         }
     }
     if ($model !== null && $version !== null) {
         // "WP" is for Windows Phone
         $prefix = 'WP' . $version . ' ' . $model . WURFL_Constants::RIS_DELIMITER;
         return $prefix . $userAgent;
     }
     return $userAgent;
 }
Esempio n. 8
0
 public function applyConclusiveMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mot-', 'MOT-', 'Motorola'))) {
         return $this->getDeviceIDFromRIS($userAgent, WURFL_Handlers_Utils::firstSlash($userAgent));
     }
     return $this->getDeviceIDFromLD($userAgent, 5);
 }
Esempio n. 9
0
 public function canHandle($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowser($userAgent)) {
         return false;
     }
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mot-', 'MOT-', 'MOTO', 'moto')) || WURFL_Handlers_Utils::checkIfContains($userAgent, 'Motorola');
 }
Esempio n. 10
0
 public function applyConclusiveMatch($userAgent)
 {
     $tolerance = WURFL_Handlers_Utils::indexOfAnyOrLength($userAgent, array('/', ' '), strpos($userAgent, 'Nokia'));
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Nokia/', 'Nokia '))) {
         $tolerance = strlen($userAgent);
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
Esempio n. 11
0
 public function applyConclusiveMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("SEC-", "SAMSUNG-", "SCH"))) {
         $tolerance = WURFL_Handlers_Utils::firstSlash($userAgent);
     } elseif (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("Samsung", "SPH", "SGH"))) {
         $tolerance = WURFL_Handlers_Utils::firstSpace($userAgent);
     } else {
         $tolerance = WURFL_Handlers_Utils::secondSlash($userAgent);
     }
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
 private function tolerance($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("SEC-", "SAMSUNG-", "SCH"))) {
         return WURFL_Handlers_Utils::firstSlash($userAgent);
     }
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array("Samsung-", "SPH", "SGH"))) {
         return WURFL_Handlers_Utils::firstSpace($userAgent);
     }
     if (WURFL_Handlers_Utils::checkIfStartsWith($userAgent, "SAMSUNG/")) {
         return WURFL_Handlers_Utils::secondSlash($userAgent);
     }
     return WURFL_Handlers_Utils::firstSlash($userAgent);
 }
Esempio n. 13
0
 public function applyConclusiveMatch($userAgent)
 {
     $tolerance = WURFL_Handlers_Utils::toleranceToRisDelimeter($userAgent);
     if ($tolerance !== false) {
         return $this->getDeviceIDFromRIS($userAgent, $tolerance);
     }
     //Return no match for UAs with no extractable Android version, model and that do not start with either Mozilla or Dalvik
     if (!WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla', 'Dalvik'))) {
         return WURFL_Constants::NO_MATCH;
     }
     // Standard RIS Matching
     $tolerance = WURFL_Handlers_Utils::indexOfAnyOrLength($userAgent, array(' Build/', ' AppleWebKit'));
     return $this->getDeviceIDFromRIS($userAgent, $tolerance);
 }
Esempio n. 14
0
 public function applyRecoveryMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('WPDesktop', 'ZuneWP7')) || WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
         if (WURFL_Handlers_Utils::checkIfContainsAll($userAgent, array('Mozilla/5.0 (Windows NT ', ' ARM;', ' Edge/'))) {
             return 'generic_ms_phone_os10_desktopmode';
         }
         if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'WPDesktop')) {
             return 'generic_ms_phone_os8_desktopmode';
         }
         if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Trident/5.0')) {
             return 'generic_ms_phone_os7_5_desktopmode';
         }
         return 'generic_ms_phone_os7_desktopmode';
     }
     $version = self::getWindowsPhoneVersion($userAgent);
     if ($version == "10.0") {
         return 'generic_ms_phone_os10';
     }
     if ($version == "8.1") {
         return 'generic_ms_phone_os8_1';
     }
     if ($version == "8.0") {
         return 'generic_ms_phone_os8';
     }
     if ($version == "7.8") {
         return 'generic_ms_phone_os7_8';
     }
     if ($version == "7.5") {
         return 'generic_ms_phone_os7_5';
     }
     if ($version == "7.0") {
         return 'generic_ms_phone_os7';
     }
     if ($version == "6.5") {
         return 'generic_ms_winmo6_5';
     }
     //These are probably UAs of the type "Windows Phone Ad Client (Xna)/5.1.0.0 BMID/E67970D969"
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Windows Phone Ad Client', 'WindowsPhoneAdClient'))) {
         return 'generic_ms_phone_os7';
     }
     return WURFL_Constants::NO_MATCH;
 }
Esempio n. 15
0
 /**
  * Applies Catch-All match
  * @param string $userAgent
  * @return string WURFL deviceID
  */
 public function applyRecoveryCatchAllMatch($userAgent)
 {
     if (WURFL_Handlers_Utils::isDesktopBrowserHeavyDutyAnalysis($userAgent)) {
         return WURFL_Constants::GENERIC_WEB_BROWSER;
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'CoreMedia')) {
         return 'apple_iphone_coremedia_ver1';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Windows CE')) {
         return 'generic_ms_mobile';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/7.2')) {
         return 'opwv_v72_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/7')) {
         return 'opwv_v7_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/6.2')) {
         return 'opwv_v62_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/6')) {
         return 'opwv_v6_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/5')) {
         return 'upgui_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/4')) {
         return 'uptext_generic';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'UP.Browser/3')) {
         return 'uptext_generic';
     }
     // Series 60
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'Series60')) {
         return 'nokia_generic_series60';
     }
     // Access/Net Front
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.0', 'ACS-NF/3.0'))) {
         return 'generic_netfront_ver3';
     }
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.1', 'ACS-NF/3.1'))) {
         return 'generic_netfront_ver3_1';
     }
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.2', 'ACS-NF/3.2'))) {
         return 'generic_netfront_ver3_2';
     }
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('NetFront/3.3', 'ACS-NF/3.3'))) {
         return 'generic_netfront_ver3_3';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/3.4')) {
         return 'generic_netfront_ver3_4';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/3.5')) {
         return 'generic_netfront_ver3_5';
     }
     if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'NetFront/4.0')) {
         return 'generic_netfront_ver4_0';
     }
     // Contains Mozilla/, but not at the beginning of the UA
     // ie: MOTORAZR V8/R601_G_80.41.17R Mozilla/4.0 (compatible; MSIE 6.0 Linux; MOTORAZR V88.50) Profile/MIDP-2.0 Configuration/CLDC-1.1 Opera 8.50[zh]
     if (strpos($userAgent, 'Mozilla/') > 0) {
         return WURFL_Constants::GENERIC_XHTML;
     }
     if (WURFL_Handlers_Utils::checkIfContainsAnyOf($userAgent, array('Obigo', 'AU-MIC/2', 'AU-MIC-', 'AU-OBIGO/', 'Teleca Q03B1'))) {
         return WURFL_Constants::GENERIC_XHTML;
     }
     // DoCoMo
     if (WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('DoCoMo', 'KDDI'))) {
         return 'docomo_generic_jap_ver1';
     }
     if (WURFL_Handlers_Utils::isMobileBrowser($userAgent)) {
         return WURFL_Constants::GENERIC_MOBILE;
     }
     return WURFL_Constants::GENERIC;
 }
 /**
  * Final Interceptor: Intercept
  * Everything that has not been trapped by a previous handler
  *
  * @param string $userAgent
  * @return boolean always true
  */
 public function canHandle($userAgent)
 {
     return WURFL_Handlers_Utils::checkIfStartsWithAnyOf($userAgent, array('Mozilla/4', 'Mozilla/5'));
 }