Project

General

Profile

Bug #22697 » 14458.diff

Administrator Admin, 2010-05-22 12:57

View differences:

t3lib/utility/class.t3lib_utility_client.php (working copy)
// Since some UAs have more than one phrase (e.g Firefox has a Gecko phrase,
// Opera 7,8 have a MSIE phrase), use the last one found (the right-most one
// in the UA). That's usually the most correct.
// For IE use the first match as IE sends multiple MSIE with version, from higher to lower.
$lastIndex = count($matches['browser']) - 1;
$browserInfo['browser'] = $matches['browser'][$lastIndex];
$browserInfo['version'] = $matches['version'][$lastIndex];
$browserInfo['version'] = $browserInfo['browser'] === 'msie' ? $matches['version'][0] : $matches['version'][$lastIndex];
//But return all parsed browsers / version in an extra array
for ($i = 0; $i <= $lastIndex; $i++) {
$browserInfo['all'][$matches['browser'][$i]] = $matches['version'][$i];
if (!isset($browserInfo['all'][$matches['browser'][$i]])) {
$browserInfo['all'][$matches['browser'][$i]] = $matches['version'][$i];
}
}
}
(1-1/2)