- Affected version
- 2.2.6 Patch 1
Hidden behind a redirect is a bunch of N+1 query behaviour from the view check, if a number of profile posts exist on a banned user
Should add a with statement;
And/or then update
Or filter out banned users in the query which is probably a better solution to the additional join
ProfileUser.Ban
needs to be loaded to check if the user is permanently banned. If so, then the user profile is hidden from the result set.Should add a with statement;
PHP:
protected function applyFilters(XF\Finder\ProfilePost $profilePostFinder, array $filters)
{
$profilePostFinder->with('ProfileUser.Ban');
....
And/or then update
canViewFullProfile
to move the canBypassUserPrivacy
to before accessing the relationship.Or filter out banned users in the query which is probably a better solution to the additional join
Last edited: