diff --git browscap.module browscap.module index f12823d..436fc4f 100644 --- browscap.module +++ browscap.module @@ -85,7 +85,9 @@ function browscap_exit() { // If monitoring is enabled, record the browser if (variable_get('browscap_monitor', FALSE)) { if ($browser = browscap_get_browser()) { - $browserstring = substr(trim($browser['parent']), 0, 255); + if (array_key_exists('parent',$browser)) { + $browserstring = substr(trim($browser['parent']), 0, 255); + } else { $browserstring = ''; } if ($browserstring == '' or $browserstring == 'Default Browser') { $browserstring = trim($_SERVER['HTTP_USER_AGENT']); } @@ -111,6 +113,7 @@ function browscap_cron() { // Has it been a week since the last (attempt to) import? $last_imported = variable_get('browscap_imported', 0); if (($last_imported + 60*60*24*7) < REQUEST_TIME) { + require_once(drupal_get_path('module','browscap') . '/includes/admin.inc'); _browscap_import(); variable_set('browscap_imported', REQUEST_TIME); }