The array that is returned from browscap_get_browser returns with an element of "crawler" that is NOT boolean. It is either the string of "true" or "false". The string of "false" when cast to bool is true.

=== modified file 'drupal/sites/all/modules/browscap/browscap.module'
--- drupal/sites/all/modules/browscap/browscap.module 2010-09-09 08:00:17 +0000
+++ drupal/sites/all/modules/browscap/browscap.module 2010-09-22 16:46:54 +0000
@@ -287,7 +287,7 @@
*/
function browscap_is_crawler($useragent = NULL) {
$browser = browscap_get_browser($useragent);
- return (bool)$browser['crawler'];
+ return (bool)_browscap_boolean($browser['crawler']);
}

// A numeric interpretation of browscap.csv's TRUE/FALSE/default fields

Comments

bschilt’s picture

This problem affects me too. I created a related issue: #923374: Boolean values are being stored as strings 'true' and 'false'

rsevero’s picture

Status: Active » Closed (duplicate)