• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

Repeated && clause

megabosx

Active member
#1
Not sure if this is the right place to raise this as it's not really a bug but i noticed a repeated && clause in the code section that alerts tagged members in a profile post. here is the excerpt.

Code:
if ($user['user_id'] != $taggingUser['user_id']

                    && !$userModel->isUserIgnored($user, $profilePost['user_id'])
                    && !$userModel->isUserIgnored($user, $profileUser['user_id'])
                    && XenForo_Model_Alert::userReceivesAlert($user, 'profile_post', 'tag')
                    && $this->canViewProfilePostAndContainer($profilePost, $profileUser, $null, $user)
                )
                {
XenForo_Model_ProfilePost line 1947,
 

Jeremy P

Well-known member
#2
If you look closely the lines are distinct. One checks to see if the user making the post is ignored, and the other checks to see if the user whose profile the post is on is ignored.