Reply to thread

If a post has a valid user mention, and then a user mention which is too long, the tagging dies.


This is because of the length test in XenForo_Model_UserTagging::_getTagMatchUsers:

[code]

        foreach ($matches AS $key => $match)

        {

            if (utf8_strlen($match[1][0]) > 50)

            {

                // longer than max username length

                continue;

            }

...

        }

...

            foreach ($matchKeys AS $key)

            {

                if ($user["match_$key"])

                {

                    $usersByMatch[$key][$user['user_id']] = $userInfo;

                }

            }

[/code]

The line "if ($user["match_$key"])" is at fault, as that key will never exist because it's generator was skipped.


This needs to be wrapped in an !empty() or isset() && $value guard.


Back
Top Bottom