diff --git a/modules/profile.module b/modules/profile.module
index 33c22f41c033844abae3a245dabeeec48ff740bb..2ed1f61db3fa7f4e76fceeb5bce5754713daf72c 100644
--- a/modules/profile.module
+++ b/modules/profile.module
@@ -120,7 +120,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
           $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
           while ($record = db_fetch_object($result)) {
             // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
-            if (in_array($record->name, $use_fields)) {
+            if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
               $fields[] = $record;
             }
           }
@@ -131,7 +131,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
           $output .= theme('profile_block', $account, $fields, true);
         }
 
-        if (in_array('user_profile', $use_fields)) {
+        if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
           $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
         }
       }
diff --git a/modules/profile/profile.module b/modules/profile/profile.module
index 33c22f41c033844abae3a245dabeeec48ff740bb..2ed1f61db3fa7f4e76fceeb5bce5754713daf72c 100644
--- a/modules/profile/profile.module
+++ b/modules/profile/profile.module
@@ -120,7 +120,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
           $result = db_query('SELECT name, title, type, visibility, weight FROM {profile_fields} WHERE visibility IN (%d, %d) ORDER BY weight', PROFILE_PUBLIC, PROFILE_PUBLIC_LISTINGS);
           while ($record = db_fetch_object($result)) {
             // Ensure that field is displayed only if it is among the defined block fields and, if it is private, the user has appropriate permissions.
-            if (in_array($record->name, $use_fields)) {
+            if (isset($use_fields[$record->name]) && $use_fields[$record->name]) {
               $fields[] = $record;
             }
           }
@@ -131,7 +131,7 @@ function profile_block($op = 'list', $delta = 0, $edit = array()) {
           $output .= theme('profile_block', $account, $fields, true);
         }
 
-        if (in_array('user_profile', $use_fields)) {
+        if (isset($use_fields['user_profile']) && $use_fields['user_profile']) {
           $output .= '<div>' . l(t('View full user profile'), 'user/' . $account->uid) . '</div>';
         }
       }