From: maxious Date: Sun, 20 Mar 2011 10:20:46 +0000 Subject: Merge branch 'master' of github.com:maxious/ACTBus-ui X-Git-Url: http://maxious.lambdacomplex.org/git/?p=busui.git&a=commitdiff&h=968a0621657bced63571d59879861523b10aacb0 --- Merge branch 'master' of github.com:maxious/ACTBus-ui --- --- a/include/common.inc.php +++ b/include/common.inc.php @@ -1,16 +1,23 @@ = 5) - || (preg_match('/symbian/i', $user_agent) - && preg_match('/platform/i', $user_agent) - && $browser['majorver'] >= 3) - || (preg_match('/blackberry/i', $user_agent) - && $browser['majorver'] >= 5) - || (preg_match('/opera mobile/i', $user_agent) - && $browser['majorver'] >= 10) - || (preg_match('/opera mini/i', $user_agent) - && $browser['majorver'] >= 5); + // http://forum.jquery.com/topic/what-is-the-best-way-to-detect-all-useragents-which-can-handle-jquery-mobile#14737000002087897 + $user_agent = $_SERVER['HTTP_USER_AGENT']; + return preg_match('/iphone/i', $user_agent) || preg_match('/android/i', $user_agent) || preg_match('/webos/i', $user_agent) || preg_match('/ios/i', $user_agent) || preg_match('/bada/i', $user_agent) || preg_match('/maemo/i', $user_agent) || preg_match('/meego/i', $user_agent) || preg_match('/fennec/i', $user_agent) || (preg_match('/symbian/i', $user_agent) && preg_match('/s60/i', $user_agent) && $browser['majorver'] >= 5) || (preg_match('/symbian/i', $user_agent) && preg_match('/platform/i', $user_agent) && $browser['majorver'] >= 3) || (preg_match('/blackberry/i', $user_agent) && $browser['majorver'] >= 5) || (preg_match('/opera mobile/i', $user_agent) && $browser['majorver'] >= 10) || (preg_match('/opera mini/i', $user_agent) && $browser['majorver'] >= 5); } function isFastDevice() { @@ -143,6 +131,7 @@ } return (strcasecmp(substr($haystack, 0, strlen($needle)) , $needle) === 0); } + function endsWith($haystack, $needle, $case = true) { if ($case) {