Merge pull request #3433 from BrokenEagle/fix-fav-privacy
Fix incorrect showing of favorites and favorite groups with privacy settings enabled
This commit is contained in:
@@ -400,12 +400,6 @@ class PostQueryBuilder
|
||||
|
||||
if q[:ordfav].present?
|
||||
user_id = q[:ordfav].to_i
|
||||
user = User.find(user_id)
|
||||
|
||||
if user.hide_favorites?
|
||||
raise User::PrivilegeError.new
|
||||
end
|
||||
|
||||
relation = relation.joins("INNER JOIN favorites ON favorites.post_id = posts.id")
|
||||
relation = relation.where("favorites.user_id % 100 = ? and favorites.user_id = ?", user_id % 100, user_id).order("favorites.id DESC")
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user