MyBB Community Forums

Full Version: Error message saying # is an "unknown modifier"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Error message saying # is an "unknown modifier". after upgrading to latest version (and the one before that).

The line causing the problem is line 659 in class_parser.php:

$message = preg_replace('#'.$badword['badword'].'#is', $badword['replacement'], $message);


Why would I be getting that error message with the latest version of MyBB. I'm running PHP 7.1.

The problem occurs with 1.8.18 and 1.8.19.

This is a standard line of code from MyBB so presumably there is something in my PHP environment that conflicts with this. Any ideas?
(2018-10-09, 10:03 AM)Crazycat Wrote: [ -> ]Have a look @ https://community.mybb.com/thread-220127.html

That's just asking the same question.

I need to know the answer! Huh
(2018-10-09, 04:07 PM)broadsword Wrote: [ -> ]
(2018-10-09, 10:03 AM)Crazycat Wrote: [ -> ]Have a look @ https://community.mybb.com/thread-220127.html

That's just asking the same question.

I need to know the answer! Huh

Ahem...

The answer is in that thread. 

Why do you keep making the same thread in different forums? That will not help you at all.
(2018-10-09, 04:46 PM)Serpius Wrote: [ -> ]
(2018-10-09, 04:07 PM)broadsword Wrote: [ -> ]
(2018-10-09, 10:03 AM)Crazycat Wrote: [ -> ]Have a look @ https://community.mybb.com/thread-220127.html

That's just asking the same question.

I need to know the answer! Huh

Ahem...

The answer is in that thread. 

Why do you keep making the same thread in different forums? That will not help you at all.



The answer is not in that thread - or this one! Huh

I created a new thread as this one describes the underlying cause rather than just describing one of the symptoms.

The first one is clearly misleading people, including you, hence why it's been closed to further comments.
So, read https://github.com/mybb/mybb/pull/3353#i...-413702257 and check your badwords :
Quote:Effect: The dynamic word filters (using symbols to catch unknown characters) already set by admins will not work as intended due to the logic change in symbol (*) usage. From now onwards the symbols '*' (any number of any character) and '+' (one number of any character) will be used efficiently. For example: *on* will catch 'congo', 'ontology' or 'moron'. However, on+ will catch 'one' it will not catch 'ton' or 'onion'. my++ will catch 'mybb' and 'myth', but will not catch 'mya','mummy' or 'mystery'.

Corrective Action: Admins are required to edit all the already existing dynamic word filters and define the word as per the new logic to achieve intended behavior.
Good news. Sorted. I found a bad word which included a '#'.

So even without regex being active, this was being treated as an escape character.

A slightly unusual case but hope someone else finds this useful. Might be worth escaping these in a future release.