Hi,

I think the property ismobiledevice for mt_browscap_is_mobile_device returns a string now. Not sure whether it's an update on browscap or some other thing. Anyway, attached the patch that might help.

CommentFileSizeAuthor
ismobiledevice-property-1.patch604 bytesdsdeiz
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Alex Savin’s picture

Shouldn't this be fixed in browscap.module? Something like:

--- Base (BASE)
+++ Locally Modified (Based On LOCAL)
@@ -184,6 +184,14 @@
     // Unserialize the user agent data found in the cache or the database
     $properties = unserialize($user_agent_properties->data);
 
+    // Unserialization makes all values strings so here we cast the boolean
+    // ones to boolean. The string "false" is evaluated as TRUE in if("false").
+    foreach ($properties as $key => &$value) {
+      if (in_array($value, array('true', 'false'))) {
+        eval('$value = ' . $value . ';');
+      }
+    }
+
     // Set the user agent name and name pattern
     $properties['useragent'] = $user_agent;
     $properties['browser_name_pattern'] = strtr($user_agent_properties->useragent, '%_', '*?');

... in browscap_get_browser function?