Index: includes/bootstrap.inc
===================================================================
RCS file: /cvs/drupal/drupal/includes/bootstrap.inc,v
retrieving revision 1.194
diff -u -p -r1.194 bootstrap.inc
--- includes/bootstrap.inc	5 Oct 2007 14:50:25 -0000	1.194
+++ includes/bootstrap.inc	7 Oct 2007 22:42:47 -0000
@@ -825,7 +825,15 @@ function drupal_is_denied($type, $mask) 
   // these, we return 1 (denied). If no matching records or only ones
   // with status = 1, we get no return from db_result, so we return
   // (bool)NULL = 0 (allowed).
-  return (bool) db_result(db_query_range("SELECT 1 FROM {access} WHERE type = '%s' AND LOWER('%s') LIKE LOWER(mask) AND status = 0", $type, $mask, 0, 1));
+  switch ($type) {
+    case 'host':
+      return (bool) db_result(db_query_range("SELECT 1 FROM {access} WHERE type = 'host' AND mask LIKE '%s' AND status = 0", $mask, 0, 1));
+      break;
+    case 'mail':
+    case 'user':
+      return (bool) db_result(db_query_range("SELECT 1 FROM {access} WHERE type = '%s' AND LOWER('%s') LIKE LOWER(mask) AND status = 0", $type, $mask, 0, 1));
+      break;
+  }
 }
 
 /**
