Bug #14520
closedNewer mobile phones are not recognized by condition [device = wap]
0%
Description
The list of WAP mobile devices in class.t3lib_matchcondition.php seems to be outdated. E.g. a Samsung mobile (user agent: SAMSUNG-SGH-E700/BSI2.0 UP.Browser/6.1.0.6 (GUI) MMP/1.0 UP.Link/1.1) is not detected by function 'whichDevice'.
The use of condition [useragent = .....] is also a pain in this case, because this seems to be case sensitive and the many mobiles by the same manufacturer come with different user agents in different cases.
While it seems to be quite a pain, to get an overview of the many user agents out there for mobile phones, it still would make sense to make this condition more powerful. You can grab a list of Useragents at http://webcab.de/wapua.htm
I just added some eregi's to the function 'whichDevice', to make my wap page work with my friend's mobile phones. Since I am not a programmer I am not sure, how harmfull my changes are - changing the Typo3 core code, done by me is like - you know the elephant in the porcelain shop - so please check this before you use it, esp.the recognition of the 'LG' mobile (user agent: LG/U8120/v1.0) might be problematic.
function whichDevice($useragent) {
$agent=strtolower(trim($useragent));
// pda
if( strstr($agent, 'avantgo')) {
return 'pda';
}
// wap
$browser=strtolower(substr($agent,0,4));
//debug($browser);
$wapviwer=substr(stristr($agent,'wap'),0,3);
if( $wapviwer=='wap' ||
$browser=='noki' ||
$browser== 'eric' ||
$browser== 'r380' ||
$browser== 'up.b' ||
$browser== 'winw' ||
eregi('siemens', $agent) ||
eregi('up.browser', $agent) ||
eregi('samsung', $agent) ||
eregi('alcatel', $agent) ||
eregi('ericsson', $agent) ||
eregi('mot', $agent) ||
eregi('lg', $agent) ||
eregi('sony', $agent) ||
eregi('winwap', $agent) ||
$browser== 'wapa') {
return 'wap';
}
(issue imported from #M731)