0

I get this error: Undefined index: id [/Applications/XAMPP/xamppfiles/htdocs/tera-wurfl/TeraWurfl.php, line 297]

Executing this function:

public static function getTeraWurflData() {
         $capabilities = array(
             'brand_name',
             'model_name',  
             'is_wireless_device',           
         );                 

         $ua = WurflSupport::getUserAgent(); 
         $wurflObj = new TeraWurfl();    
         $matched = false;  
         $matched = $wurflObj->getDeviceCapabilitiesFromAgent($ua, true);
         $deviceCapabilities = array();  
         foreach ($capabilities as $capability) {
             $deviceCapabilities[$capability] = $wurflObj->getDeviceCapability($capability);
         }

         $deviceCapabilities['user_agent'] = $ua;

         if ($_SERVER)      
         {
             $ip = $_SERVER["REMOTE_ADDR"];  
         }
         else
         {
             if ( getenv( "HTTP_X_FORWARDED_FOR" ) )
                 $ip = getenv( "HTTP_X_FORWARDED_FOR" );
             else
                 if ( getenv( "HTTP_CLIENT_IP" ) )
                     $ip = getenv("HTTP_CLIENT_IP"); 
                 else
                     $ip = getenv("REMOTE_ADDR");    
         }

         $deviceCapabilities['ip'] = $ip;

         return $deviceCapabilities;     
      }

I had no problems with my Tera-WURFL config, anybody have this happen before?

8vius
  • 5,786
  • 14
  • 74
  • 136
  • Looks like the QC of Tera-WURFL has forgotten to add an index check prior accessing an array entry. This will always happen until the check is added to the library. You might consider reporting the issue to their development team. See as well: http://dbapi.scientiamobile.com/wiki/index.php/Support – hakre Jul 27 '11 at 15:35
  • Will do hakre, since it's just a notice I decided to simply suppress it, and everything works fine – 8vius Jul 27 '11 at 16:34

1 Answers1

1

I found the solution to this problem, you just need to set your Tera-WURFL to work with MySQL4 and not 5 in your configuration file this will make it so the problem disappears. Here is a link to my post in the Tera forums that helped me resolve the issue

8vius
  • 5,786
  • 14
  • 74
  • 136