--- mobile_tools.module.orig	2009-09-27 17:30:29.000000000 +0200
+++ mobile_tools.module	2009-09-27 17:36:03.000000000 +0200
@@ -630,19 +630,19 @@
   $accept           = $_SERVER['HTTP_ACCEPT']; // get the content accept value - this should be cleaned to ensure no nefarious input gets executed
   
    switch (TRUE) { 
-    case (eregi('ipod', $user_agent)); // we find the words iphone or ipod in the user agent
+    case (FALSE !== stripos($user_agent, 'ipod')); // we find the words iphone or ipod in the user agent
       $mobile_browser = array('type' => 'mobile', 'group' => 'ipod'); // mobile browser is either TRUE or FALSE depending on the setting of iphone when calling the function
     break; // break out and skip the rest if we've had a match on the iphone or ipod
-    case (eregi('iphone', $user_agent)); // we find the words iphone or ipod in the user agent
+    case (FALSE !== stripos($user_agent, 'iphone')); // we find the words iphone or ipod in the user agent
       $mobile_browser = array('type' => 'mobile', 'group' => 'iphone');
     break;
-    case (eregi('android',$user_agent));  // we find android in the user agent
+    case (FALSE !== stripos($user_agent, 'android'));  // we find android in the user agent
       $mobile_browser = array('type' => 'mobile', 'group' => 'android');; // mobile browser is either TRUE or FALSE depending on the setting of android when calling the function
     break; // break out and skip the rest if we've had a match on android
-    case (eregi('opera mini',$user_agent)); // we find opera mini in the user agent
+    case (FALSE !== stripos($user_agent, 'opera mini')); // we find opera mini in the user agent
       $mobile_browser = array('type' => 'mobile', 'group' => 'opera mini'); // mobile browser is either TRUE or FALSE depending on the setting of opera when calling the function
     break; // break out and skip the rest if we've had a match on opera
-    case (eregi('blackberry',$user_agent)); // we find blackberry in the user agent
+    case (FALSE !== stripos($user_agent, 'blackberry')); // we find blackberry in the user agent
       $mobile_browser = array('type' => 'mobile', 'group' => 'blackberry'); // mobile browser is either TRUE or FALSE depending on the setting of blackberry when calling the function
     break; // break out and skip the rest if we've had a match on blackberry
     case (preg_match('/(up.browser|up.link|mmp|symbian|smartphone|midp|wap|vodafone|o2|pocket|kindle|mobile|pda|psp|treo)/i',$user_agent)); // check if any of the values listed create a match on the user agent - these are some of the most common terms used in agents to identify them as being mobile devices - the i at the end makes it case insensitive
