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)
Updated by Michael Stucki almost 20 years ago
Thanks Michael for starting that topic. You sent me one other link about the so-called WURFL project: http://wurfl.sourceforge.net/
Personally I like the idea of this but I think it's too large to fit into the core.
Suggestion is to add a hook for this in class.t3lib_matchcondition.php and make the WURFL data accessible by a separate extension.
Updated by Michael Stucki almost 19 years ago
Hey Perki! Is this bug still open? If you support my suggestion to use a hook for this, please prepare a patch and assign the bug to me.
Regards, michael
Updated by Michael Stucki almost 19 years ago
Waiting for feedback from Perki...
Updated by Christian Kuhn over 15 years ago
Resolved, no change required:
With revision 1421 from 2006-04-10 there is a hook in this function that can be used from extensions to expand function whichDevice.