31 $getBrowserInfoHooks = &
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/div/class.t3lib_utility_client.php'][
'getBrowserInfo'];
32 if (is_array($getBrowserInfoHooks)) {
33 foreach ($getBrowserInfoHooks as $hookFunction) {
35 $hookParameters = array(
36 'userAgent' => &$userAgent,
37 'returnResult' => &$returnResult
43 if ($returnResult && is_array($hookResult) && count($hookResult)) {
48 $userAgent = trim($userAgent);
50 'useragent' => $userAgent
76 $pattern =
'#(?P<browser>' . join(
'|', $known) .
')[/ ]+(?P<version>[0-9]+(?:\\.[0-9]+)?)#';
78 if (!preg_match_all($pattern, strtolower($userAgent), $matches)) {
84 $pattern =
'#mozilla/5\\.0 \\(.*trident/7\\.0.*; rv:(?P<version>[0-9]+(?:\\.[0-9]+)?)\\) like gecko#i';
85 if (preg_match_all($pattern, $userAgent, $matches)) {
86 $browserInfo[
'browser'] =
'msie';
87 $browserInfo[
'version'] = $matches[
'version'][0];
88 $browserInfo[
'all'] = array(
'msie' => $matches[
'version'][0]);
90 $browserInfo[
'browser'] =
'unknown';
91 $browserInfo[
'version'] =
'';
92 $browserInfo[
'all'] = array();
99 $lastIndex = count($matches[
'browser']) - 1;
100 $browserInfo[
'browser'] = $matches[
'browser'][$lastIndex];
101 $browserInfo[
'version'] = $browserInfo[
'browser'] ===
'msie' ? $matches[
'version'][0] : $matches[
'version'][$lastIndex];
103 $browserInfo[
'all'] = array();
104 for ($i = 0; $i <= $lastIndex; $i++) {
105 if (!isset($browserInfo[
'all'][$matches[
'browser'][$i]])) {
106 $browserInfo[
'all'][$matches[
'browser'][$i]] = $matches[
'version'][$i];
110 if (isset($browserInfo[
'all'][
'gecko'])) {
111 preg_match_all(
'/rv:([0-9\\.]*)/', strtolower($userAgent), $version);
112 if ($version[1][0]) {
113 $browserInfo[
'all'][
'gecko'] = $version[1][0];
117 $browserInfo[
'all_systems'] = array();
118 if (strstr($userAgent,
'Win')) {
120 if (strstr($userAgent,
'Windows NT 6.2') || strstr($userAgent,
'Windows NT 6.3')) {
121 $browserInfo[
'all_systems'][] =
'win8';
122 $browserInfo[
'all_systems'][] =
'winNT';
123 } elseif (strstr($userAgent,
'Windows NT 6.1')) {
124 $browserInfo[
'all_systems'][] =
'win7';
125 $browserInfo[
'all_systems'][] =
'winNT';
126 } elseif (strstr($userAgent,
'Windows NT 6.0')) {
127 $browserInfo[
'all_systems'][] =
'winVista';
128 $browserInfo[
'all_systems'][] =
'winNT';
129 } elseif (strstr($userAgent,
'Windows NT 5.1')) {
130 $browserInfo[
'all_systems'][] =
'winXP';
131 $browserInfo[
'all_systems'][] =
'winNT';
132 } elseif (strstr($userAgent,
'Windows NT 5.0')) {
133 $browserInfo[
'all_systems'][] =
'win2k';
134 $browserInfo[
'all_systems'][] =
'winNT';
135 } elseif (strstr($userAgent,
'Win98') || strstr($userAgent,
'Windows 98')) {
136 $browserInfo[
'all_systems'][] =
'win98';
137 } elseif (strstr($userAgent,
'Win95') || strstr($userAgent,
'Windows 95')) {
138 $browserInfo[
'all_systems'][] =
'win95';
139 } elseif (strstr($userAgent,
'WinNT') || strstr($userAgent,
'Windows NT')) {
140 $browserInfo[
'all_systems'][] =
'winNT';
141 } elseif (strstr($userAgent,
'Win16') || strstr($userAgent,
'Windows 311')) {
142 $browserInfo[
'all_systems'][] =
'win311';
144 } elseif (strstr($userAgent,
'Mac')) {
145 if (strstr($userAgent,
'iPad') || strstr($userAgent,
'iPhone') || strstr($userAgent,
'iPod')) {
146 $browserInfo[
'all_systems'][] =
'iOS';
147 $browserInfo[
'all_systems'][] =
'mac';
149 $browserInfo[
'all_systems'][] =
'mac';
151 } elseif (strstr($userAgent,
'Android')) {
152 $browserInfo[
'all_systems'][] =
'android';
153 $browserInfo[
'all_systems'][] =
'linux';
154 } elseif (strstr($userAgent,
'Linux')) {
155 $browserInfo[
'all_systems'][] =
'linux';
156 } elseif (strstr($userAgent,
'BSD')) {
157 $browserInfo[
'all_systems'][] =
'unix_bsd';
158 } elseif (strstr($userAgent,
'SGI') && strstr($userAgent,
' IRIX ')) {
159 $browserInfo[
'all_systems'][] =
'unix_sgi';
160 } elseif (strstr($userAgent,
' SunOS ')) {
161 $browserInfo[
'all_systems'][] =
'unix_sun';
162 } elseif (strstr($userAgent,
' HP-UX ')) {
163 $browserInfo[
'all_systems'][] =
'unix_hp';
164 } elseif (strstr($userAgent,
'CrOS')) {
165 $browserInfo[
'all_systems'][] =
'chrome';
166 $browserInfo[
'all_systems'][] =
'linux';
179 return doubleval(preg_replace(
'/^[^0-9]*/',
'', $version));
190 $getDeviceTypeHooks = &
$GLOBALS[
'TYPO3_CONF_VARS'][
'SC_OPTIONS'][
't3lib/div/class.t3lib_utility_client.php'][
'getDeviceType'];
191 if (is_array($getDeviceTypeHooks)) {
192 foreach ($getDeviceTypeHooks as $hookFunction) {
193 $returnResult = TRUE;
194 $hookParameters = array(
195 'userAgent' => &$userAgent,
196 'returnResult' => &$returnResult
202 if ($returnResult && is_string($hookResult) && !empty($hookResult)) {
207 $userAgent = strtolower(trim($userAgent));
210 if (strstr($userAgent,
'avantgo')) {
214 $browser = substr($userAgent, 0, 4);
215 $wapviwer = substr(stristr($userAgent,
'wap'), 0, 3);
216 if ($wapviwer ==
'wap' || $browser ==
'noki' || $browser ==
'eric' || $browser ==
'r380' || $browser ==
'up.b' || $browser ==
'winw' || $browser ==
'wapa') {
220 if (strstr($userAgent,
'g.r.a.b.') || strstr($userAgent,
'utilmind httpget') || strstr($userAgent,
'webcapture') || strstr($userAgent,
'teleport') || strstr($userAgent,
'webcopier')) {
221 $deviceType =
'grabber';
224 if (strstr($userAgent,
'crawler') || strstr($userAgent,
'spider') || strstr($userAgent,
'googlebot') || strstr($userAgent,
'searchbot') || strstr($userAgent,
'infoseek') || strstr($userAgent,
'altavista') || strstr($userAgent,
'diibot')) {
225 $deviceType =
'robot';
static getBrowserInfo($userAgent)
static getDeviceType($userAgent)
static getVersion($version)
static callUserFunction($funcName, &$params, &$ref, $checkPrefix='', $errorMode=0)
if(!defined('TYPO3_MODE')) $GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_userauth.php']['logoff_pre_processing'][]