Lack of interest [Developer Tool] Make the regex in getMentionsBbCode extendable

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.

DragonByte Tech

Well-known member
I am working on an addon to, among other things, allow @ mentions for user groups. In the case where a user's name and user group name is very similar (e.g. a user called Vet and a user group called Veteran) conflicts can occur because we cannot add new BBCode to the exclusion list.

This issue can be easily avoided by changing this line
PHP:
'#\[(code|php|html|plain|media|url|img|user|quote)(=[^\]]*)?](.*)\[/\\1]#siU'
to this
PHP:
'#\[(' . $this->getBbCodeStopList() . ')(=[^\]]*)?](.*)\[/\\1]#siU'
then adding this function
PHP:
    protected function getBbCodeStopList()
    {
        return 'code|php|html|plain|media|url|img|user|quote';
    }

With this simple change, addons can easily override this list, and you would also be making some small amount of progress on the TODO comment above the placeholder regex since you yourself can expand on that function in future updates :)

Thanks for considering :)


Fillip
 
Upvote 4
This suggestion has been closed. Votes are no longer accepted.
Top Bottom