diff options
-rw-r--r-- | modules/profile.module | 4 | ||||
-rw-r--r-- | modules/profile/profile.module | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/modules/profile.module b/modules/profile.module index 33c22f41c..2ed1f61db 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 33c22f41c..2ed1f61db 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>'; } } |