Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: Vincenz0 on November 02, 2016, 06:27:56 AM

Title: 2.0.11 to 2.0.12 Added new code that leaves a lot of messages empty.
Post by: Vincenz0 on November 02, 2016, 06:27:56 AM
Hello devs.

With the latest patch you guys added the following code to the Subs-Post.php file:

// Remove empty bbc.
$message = preg_replace('~\[([^\]=\s]+)[^\]]*\](?' . '>\s|(?R))*?\[/\1\]\s?~i', '', $message);


My preg knowledge is not enough to know what exactly this does but it is creating problems for us.

If a user uses too many BBC codes or something the whole message gets truncated into nothing and they get an error that the message body is empty, also when clicking Preview, the preview would be empty.

For my forum I just commented out this whole line and it solved our problems.
Any idea what is going on?

Here is a test code to reproduce it:
http: // paste . ubuntu . com/23415521/
(remove spaces)

I tried adding the above code in a CODE bracket on this forum but it gave me the same error:
(https://i.imgur.com/8tmb5I3.png)
Title: Re: 2.0.11 to 2.0.12 Added new code that leaves a lot of messages empty.
Post by: Kindred on November 02, 2016, 07:47:14 AM
please do not double post the same message.

If you read the other thread that you posted in  you would know that we are aware of the issue and are working on a patch to fix it.