It's this piece of code which assumes there is an key "1" in the array, while its not:
Code: Select all
$significant_version = explode('.', $version);
if ($significant_version[0] !== null) {
if ($significant_version[1] === 0) {
$deviceID = 'generic_ms_phone_os'.$significant_version[0].'_subuaucweb';
}
else {
$deviceID = 'generic_ms_phone_os'.$significant_version[0].'_'.$significant_version[1].'_subuaucweb';
}
if (in_array($deviceID, self::$constantIDs)) {
return $deviceID;
}
}
Code: Select all
if ( !array_key_exists(1, $significant_version )|| $significant_version[1] === 0) {
$deviceID = 'generic_ms_phone_os'.$significant_version[0].'_subuaucweb';
}
else {
$deviceID = 'generic_ms_phone_os'.$significant_version[0].'_'.$significant_version[1].'_subuaucweb';
}
Code: Select all
Mozilla/5.0 (Linux; U; Android 8.0; en-US; Windows Phone 8 Build/JDQ39) AppleWebKit/534.30 (KHTML, like Gecko) Version/4.0 UCBrowser/10.8.0.718 U3/0.8.0 Mobile Safari/534.30
Code: Select all
//iPhone U3K
else if (WURFL_Handlers_Utils::checkIfContains($userAgent, 'iPhone;')) {
if (preg_match('/iPhone OS (\d+)(?:_(\d+))?(?:_\d+)* like/', $userAgent, $matches)) {
$version = $matches[1].'.'.$matches[2];
$prefix = "$version U3iPhone $ucb_version".WURFL_Constants::RIS_DELIMITER;
return $prefix.$userAgent;
}
}
Code: Select all
$version = (array_key_exists( 1, $matches) ? $matches[1] : '').'.'.(array_key_exists( 2, $matches) ? $matches[2] : '');
Code: Select all
Mozilla/5.0 (iPhone; CPU iPhone OS 84 like Mac OS X; zh-CN) AppleWebKit/537.51.1 (KHTML like Gecko) Mobile/12H143 UCBrowser/10.3.0.547 Mobile