Advertisement:

Author Topic: [2.0.12] Cannot post tables in messages anymore due to [h r] in table  (Read 17050 times)

Offline faresshajrii

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #20 on: October 01, 2016, 07:05:22 PM »
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.


Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #21 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
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

Offline Brettflan

  • Full Member
  • ***
  • Posts: 496
  • Gender: Male
    • TaleWorlds Forum
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #22 on: October 01, 2016, 08:38:53 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.

Offline faresshajrii

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #23 on: October 02, 2016, 06:54:34 AM »
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.

Offline _Jojo_

  • Jr. Member
  • **
  • Posts: 258
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #24 on: October 05, 2016, 04:04:12 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.
Achtung: Dieser Post befindet sich noch im Beta-Stadium und kann durchaus Fehler in der Groß- und Kleinschreibung oder sonstige Unklarheiten enthalten. Wenden Sie sich bei Problemen an den Support.

Offline _Jojo_

  • Jr. Member
  • **
  • Posts: 258
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #25 on: October 06, 2016, 07:35:02 AM »
And here's an even more minimal test case: http://pastebin.com/f8wHXK8D
Achtung: Dieser Post befindet sich noch im Beta-Stadium und kann durchaus Fehler in der Groß- und Kleinschreibung oder sonstige Unklarheiten enthalten. Wenden Sie sich bei Problemen an den Support.

Offline Suki

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 15,083
  • Kaizoku Jotei
    • MissAllSunday on GitHub
    • SMF mods
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #26 on: October 06, 2016, 11:49:42 AM »
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.
Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 417
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #27 on: October 07, 2016, 06:52:29 AM »
Is a solution to use html blocks?
MacOsX - 10.12.4
SMF 2.0.13
Safari (last) or Chrome (last)

Offline Suki

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 15,083
  • Kaizoku Jotei
    • MissAllSunday on GitHub
    • SMF mods
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #28 on: October 07, 2016, 09:01:01 AM »
That would only work for admins I'm afraid.
Look at them. They're just asking for it. Maybe the human race deserves to be wiped out.

Offline Raffaele1977

  • Full Member
  • ***
  • Posts: 417
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #29 on: October 09, 2016, 10:01:28 AM »
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 - 10.12.4
SMF 2.0.13
Safari (last) or Chrome (last)

Offline seydon

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #30 on: October 12, 2016, 09:50:11 PM »
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]

Offline seydon

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #31 on: October 12, 2016, 09:55:52 PM »
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]

Offline SMiFFER

  • Jr. Member
  • **
  • Posts: 222
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #32 on: October 13, 2016, 01:35:10 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.

« Last Edit: October 13, 2016, 01:56:56 AM by SMiFFER »
...coming from VB, using SMF since 2012, now hosting it myself
currently 2.0.15

Offline neosymmetrical

  • Semi-Newbie
  • *
  • Posts: 11
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #33 on: October 13, 2016, 02:32:10 AM »
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.

Offline The Lurker

  • Semi-Newbie
  • *
  • Posts: 27
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #34 on: October 15, 2016, 09:29:47 AM »
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.


Offline BaileyD

  • Newbie
  • *
  • Posts: 3
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #35 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.

Offline lurkalot

  • Sr. Member
  • ****
  • Posts: 978
  • Gender: Male
  • Tinyportal Support
    • guitaristguild on Facebook
    • Tinyportal on GitHub
    • @GuitaristGuild on Twitter
    • Guitarist Guild
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #36 on: October 16, 2016, 05:16:30 AM »
[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

Offline SevenUp

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #37 on: October 28, 2016, 04:46:48 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.

Offline Vincenz0

  • Newbie
  • *
  • Posts: 2
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #38 on: November 02, 2016, 06:34:48 AM »
So the problem is this:
With the latest patch you guys added the following code to the Subs-Post.php file:

Code: [Select]
// 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:

Offline Kindred

  • The Mean One
  • Support Specialist
  • SMF Legend
  • *
  • Posts: 55,098
  • Gender: Male
    • Kindred-999 on GitHub
Re: [2.0.12] Cannot post tables in messages anymore due to [h r] in table
« Reply #39 on: November 02, 2016, 07:43:25 AM »
yes... we know (did you read the whole thread?).
We are working on a fix.
Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.