Lack of interest [XF1] UserTagging breaking my custom BB codes

This suggestion has been closed automatically because it did not receive enough votes over an extended period of time. If you wish to see this, please search for an open suggestion and, if you don't find any, post a new one.

Rasmus Vind

Well-known member
For historical reasons I have a [highlight=language] tag. I think @digitalpoint made it back in the day. Possibly for vBulletin back then. I recently received a bug report where a user was highlighting code for a language full of @ symbols which did not have the desired effect. Random old users were @-mentioned instead.

Here is the code in XenForo_Model_UserTagging that does this:
PHP:
    public function getTaggedUsersInMessage($message, &$newMessage, $replaceStyle = 'bb')
    {
        // always set this for early returns
        $newMessage = $message;
        $filteredMessage = $message;
        $this->_plainReplacements = null;

        if ($replaceStyle == 'bb')
        {
            $this->_plainReplacements = array();
            $filteredMessage = preg_replace_callback(
                '#\[(code|php|html|plain|media|url|img|user|quote)(=[^\]]*)?](.*)\[/\\1]#siU',
                array($this, '_plainReplaceHandler'),
                $filteredMessage
            );
        }
        else if ($replaceStyle == 'text')
        {
            $this->_plainReplacements = array();
            $filteredMessage = preg_replace_callback(
                '#(?<=^|\s|[\](,]|--|@)@\[(\d+):(\'|"|"|)(.*)\\2\]#iU',
                array($this, '_plainReplaceHandler'),
                $filteredMessage
            );
        }
// [...]
As you can see, it is hard-coded to a specific list of BB codes where user-tagging is not being done. I would very much like to be able to have this as a setting in my own custom BB code admin interface.
 
Upvote 1
This suggestion has been closed. Votes are no longer accepted.
Back
Top Bottom