News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[2.0.12] Cannot post tables in messages anymore due to [h r] in table

Started by @rjen, September 28, 2016, 08:28:45 AM

Previous topic - Next topic

faresshajrii

Please guys fix it, this bug is really annoying us, at our forums we can't even update things.

I've tested this yesterday and I confirm it's from the table BBC.


Kindred

this is not a bug. it is intentional and there is nothing to be fixed

correct your BBC and it will all be correct.

The reason you are seeing issues is because you are not entering correct/closed BBC tags
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Brettflan

Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed

correct your BBC and it will all be correct.

The reason you are seeing issues is because you are not entering correct/closed BBC tags
Did you read my post above and test the provided example that triggers it? It should only take a few seconds.

faresshajrii

Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed

correct your BBC and it will all be correct.

The reason you are seeing issues is because you are not entering correct/closed BBC tags

Not really, we are entering a correct BBCodes, there is something that make the post invalid. Not only from our forums, people from other forums and use SMF 2.0.12 got this issue.

_Jojo_

Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed

correct your BBC and it will all be correct.

The reason you are seeing issues is because you are not entering correct/closed BBC tags
Like the others say, this is a bug on multiple levels:

1. It rejects perfectly valid BBCode. Here's another example that breaks: http://pastebin.com/LmA1MbAJ I cannot post it on this forum because otherwise it will tell me the post is empty, hence I posted a link.

2. It doesn't tell the user. When your post just turns up empty, it's not your fault, it's the forum's fault. Especially if the forum doesn't tell you why.

That being said, this kind of problem really should not be solved with regular expressions.


Suki

Quote from: _Jojo_ on October 05, 2016, 04:04:12 PM
Quote from: Kindred on October 01, 2016, 07:18:04 PM
this is not a bug. it is intentional and there is nothing to be fixed

correct your BBC and it will all be correct.

The reason you are seeing issues is because you are not entering correct/closed BBC tags
Like the others say, this is a bug on multiple levels:

1. It rejects perfectly valid BBCode. Here's another example that breaks: http://pastebin.com/LmA1MbAJ I cannot post it on this forum because otherwise it will tell me the post is empty, hence I posted a link.

2. It doesn't tell the user. When your post just turns up empty, it's not your fault, it's the forum's fault. Especially if the forum doesn't tell you why.

That being said, this kind of problem really should not be solved with regular expressions.

Yes, it is a bug, an incidental one but a bug in the end.

The problem you're facing is a derivative from another one (prevent empty BBC codes). The regex used doesn't caught several BBC formats already posted here, the code's logic dictates to remove the failed test, which result in an empty post and thus the "your message is empty" message appear.

The empty message problem shouldn't be dealt with regex, thats for sure, but the empty BBC tags (the original issue) does.

We cannot change our current BBC parser to another more robust solution like a string tokenizer, therefore, regex and/or a combination of php logic plus regex is what we are going to use.

If you would like to help us, please keep posting valid BBC formats that breaks the current regex, that way we have more options to test our patch against.
Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Raffoz

MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

Suki

Disclaimer: unless otherwise stated, all my posts are personal and does not represent any views or opinions held by Simple Machines.

Raffoz

I discovered (for my case) that the problem appears every time i use the center bbc code.

Sometimes i insert a (alt+space) character after the closed center tag and it works.
MacOsX (last)
SMF 2.0.15 and 2.1.2 (different forums)
Chrome (last) or Safari (last)

seydon

Here is another example of bbcode that gives me the "empty message"... This is tested to be working great in SMF 2.0.11... I installed a fresh SMF in a test subdomain (2.0.11), created a new post with this bbcode and it worked. Installed the 2.0.12 patch and cannot post this anymore... (using the nobbc since the bbcode "code" doesn't work, as seen in this example...

If I remove the part enclosed in "code", it works... If I add a . (a simple dot) between the code bbcode and the bold, it also works...


[center][font=courier][size=18pt][glow=yellow,2,300]Thread Header[/glow][/size][/font][/center][hr]
[b][font=papyrus][size=18pt][color=darkkhaki]When: [/color][/size][/font][/b]
[b][font=papyrus][size=18pt][color=darkkhaki]Where: [/color][/size][/font][/b]   
[hr]

[code]
[b][size=18pt][font=papyrus][color=darkkhaki]When: [/color][/font][/size][/b]
[b][size=18pt][font=papyrus][color=darkkhaki]Where: [/color][/font][/size][/b]
[hr]
[/code]

seydon

a simpler version of the same code that fails (still between nobbc). Again, adding a simple . character at some locations (for example, before the first bold tag in both sections solves the issue...


[center][font=courier][size=18pt][glow=yellow,2,300]Thread Header[/glow][/size][/font][/center][hr]
[font=papyrus][size=18pt][color=darkkhaki][b]When: [/b]
[b]Where: [/b]  [/color][/size][/font] 
[hr]

[code]
[size=18pt][font=papyrus][color=darkkhaki][b]When: [/b]
[b]Where: [/b][/color][/font][/size]
[hr]
[/code]

SMiFFER

Quote from: @rjen on September 28, 2016, 11:09:58 AM
I already did in my previous post, but that does not answer my question: the error does not explain what is wrong: users will NOT understand what they did wrong...
Exactly. This error-message is absolutely misleading and therefore bad - no matter where it comes from.

It is the result what counts.

Quote of the day: A troll is an obstinate bloke who only hungers for your attention. If you feed him, he will puke all over you!

neosymmetrical

My roleplay forum is having issues as well, I assumed this was due ot the "BBC With style" mod but all of these bugs seem to be appearing on my forum as well, one of my admins is testing this out with several different codes in order to figure out whats causing it as well, if needed we can provide what we found as well.

The Lurker

I have noticed the issue when trying to post text that includes square brackets in a table.

A very stripped down example is here, because I cannot post it, even inside [nobbc] or [code] tags.

Please fix it.


Edit: image.


BaileyD

[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color][/center]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color][/center]

I created a support topic about this but I expect that having all of these combinations in one topic will help. The above runs in to the issue with no tables or anything. There's no broken tags as far as I can see either.

lurkalot

Quote from: BaileyD on October 15, 2016, 07:12:50 PM
[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color][/center]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color][/center]

I created a support topic about this but I expect that having all of these combinations in one topic will help. The above runs in to the issue with no tables or anything. There's no broken tags as far as I can see either.

Confirmed.  Strange though, because if you remove the closing center tags in this case it works.

[center][color=orange][size=18pt][font=georgia]Yes[/font][/size][/color]
[center][color=green][size=14pt][font=georgia]No[/font][/size][/color]

Yes
No

SevenUp

Quote from: Marceline on October 06, 2016, 11:49:42 AM
If you would like to help us, please keep posting valid BBC formats that breaks the current regex, that way we have more options to test our patch against.

Happy to help, if only in a limited way.  The code below
[table]
[tr][td]R1C1[/td][td]R1C2[/td][td]R1C3[/td][/tr]
[tr][td]R2C1[/td][td]        [/td][td]R2C3[/td][/tr]
[tr][td]R3C1[/td][td]R3C2[/td][td]R3C3[/td][/tr]
[/table]

now displays, instead of the expected blank middle cell,

R1C1R1C2R1C3
R2C1R2C3
R3C1R3C2R3C3

and removes the
[td]        [/td]
that was entered in the second table row.

Appreciate your efforts to restore proper table formatting.

Vincenz0

So the problem is this:
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:

Kindred

yes... we know (did you read the whole thread?).
We are working on a fix.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: