@@ -1039,8 +1039,8 @@ public function format(bool $display_custom_fields = false): array
10391039 'username_color ' => '<span ' . (!empty ($ this ->group_color ) ? 'style="color: ' . $ this ->group_color . ';" ' : '' ) . '> ' . $ this ->username . '</span> ' ,
10401040 'name_color ' => '<span ' . (!empty ($ this ->group_color ) ? 'style="color: ' . $ this ->group_color . ';" ' : '' ) . '> ' . $ this ->name . '</span> ' ,
10411041 'link_color ' => '<a href=" ' . Config::$ scripturl . '?action=profile;u= ' . $ this ->id . '" title=" ' . Lang::getTxt ('view_profile_of_username ' , ['name ' => $ this ->name ], file: 'General ' ) . '" ' . (!empty ($ this ->group_color ) ? 'style="color: ' . $ this ->group_color . ';" ' : '' ) . '> ' . $ this ->name . '</a> ' ,
1042- 'is_buddy ' => \in_array ($ this ->id , self ::$ me ->buddies ),
1043- 'is_reverse_buddy ' => \in_array (self ::$ me ->id , $ this ->buddies ),
1042+ 'is_buddy ' => ! empty (Config:: $ modSettings [ ' enable_buddylist ' ]) && \in_array ($ this ->id , self ::$ me ->buddies ),
1043+ 'is_reverse_buddy ' => ! empty (Config:: $ modSettings [ ' enable_buddylist ' ]) && \in_array (self ::$ me ->id , $ this ->buddies ),
10441044 'buddies ' => $ this ->buddies ,
10451045 'title ' => !empty (Config::$ modSettings ['titlesEnable ' ]) ? $ this ->title : '' ,
10461046 'blurb ' => $ this ->personal_text ,
@@ -3620,7 +3620,7 @@ public static function find(string|array $names, bool $use_wildcards = false, bo
36203620 AND is_activated IN ({array_int:activated})
36213621 LIMIT {int:limit} ' ,
36223622 array_merge ($ where_params , [
3623- 'buddy_list ' => self ::$ me ->buddies ,
3623+ 'buddy_list ' => ! empty (Config:: $ modSettings [ ' enable_buddylist ' ]) ? self ::$ me ->buddies : [] ,
36243624 'limit ' => $ max ,
36253625 'activated ' => [self ::ACTIVATED , self ::ACTIVATED_BANNED ],
36263626 ]),
@@ -3946,7 +3946,7 @@ protected function setProperties(): void
39463946 $ this ->time_offset = (int ) ($ profile ['time_offset ' ] ?? 0 );
39473947
39483948 // Buddies and personal messages.
3949- $ this ->buddies = !empty (Config:: $ modSettings [ ' enable_buddylist ' ]) && ! empty ( $ profile ['buddy_list ' ]) ? explode (', ' , $ profile ['buddy_list ' ]) : [];
3949+ $ this ->buddies = !empty ($ profile ['buddy_list ' ]) ? explode (', ' , $ profile ['buddy_list ' ]) : [];
39503950 $ this ->ignoreusers = !empty ($ profile ['pm_ignore_list ' ]) ? explode (', ' , $ profile ['pm_ignore_list ' ]) : [];
39513951 $ this ->pm_receive_from = (int ) ($ profile ['pm_receive_from ' ] ?? 0 );
39523952 $ this ->pm_prefs = (int ) ($ profile ['pm_prefs ' ] ?? 0 );
0 commit comments