[Forum] Spoiler Layout Breakage

Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.

Post a reply

Smilies
:D :) :( :o :shock: :? 8-) :lol: :x :P :oops: :cry: :evil: :twisted: :roll: :wink: :geek: :ugeek: :!: :?: :idea: :arrow: :| :mrgreen: :3: :wub: >:( :blergh:
View more smilies

BBCode is OFF
Smilies are ON

Topic review
   

Expand view Topic review: [Forum] Spoiler Layout Breakage

Re: [Forum] Spoiler Layout Breakage

by Dark-Assassin » Thu Jul 14, 2016 4:02 pm

Eruanna wrote:Don't worry, the more you manipulate software and code the more likely you are to create solutions like that. :)
Well, the most I have worked with the source of phpbb was making it so 3.1 allowed the use of custom bb tags and formatting tags embedded inside each other since it no longer allows it.
It's applied on the Zandronum forums and we don't seem to have a problems that I've seen or have been reported to me.
If the ZDoom were to update, I'd be happy to provide the patched files.

Re: [Forum] Spoiler Layout Breakage

by Graf Zahl » Tue Jul 12, 2016 10:17 am

Closed because not a ZDoom problem.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Tue Jul 12, 2016 1:38 am

Look more closely. It would only count the additional tags inside one tag "set", not the whole post. It already checks the whole post - if I just throw a random
Spoiler:

Re: [Forum] Spoiler Layout Breakage

by Nevander » Mon Jul 11, 2016 8:25 pm

Eruanna wrote:There is an actual "easy fix" for this. Simply count tags.

For each tag X, where [x] opens and [/x] closes, count every tag in between. Every open tag [y] increments the counter for [x] by 1, and every close tag [/y] decrements the counter.

If when [/x] closes from the tag count is not properly "0" - then reject the post, and give the user an error.

For nesting tags, this should simply be tracked from within each successful nesting.
Wouldn't the original code not throw an error still since there's two opening and two closing tags?

Based on this fix...
it would count spoiler and /quote as 2
first tag increments x to 1
second decrements x to 0
ends in 0 - no error

Code: Select all

[quote][spoiler]Stuff[/quote][/spoiler]
The tags themselves need to be error checked for proper pairing. Unless I'm just misunderstanding this fix.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Mon Jul 11, 2016 6:27 pm

Don't worry, the more you manipulate software and code the more likely you are to create solutions like that. :) I am sure when the phpBB devs read this topic (since it's linked in the report) they'll probably come up with a better solution, anyway, since they've been working with that stuff far longer than I ever could hope to.

Re: [Forum] Spoiler Layout Breakage

by Dark-Assassin » Mon Jul 11, 2016 3:06 pm

Well, I admit that's something I never even would have considered.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Mon Jul 11, 2016 5:13 am

I have gone and reported the issue. I don't know what version Randi uses so I didn't put that on the tracker, but I put my phpBB version there because the bug is still present.
Dark-Assassin wrote:It acts the same as crossing different HTML tags. It's not something that's going to be easily fixed. The best you can do is just fix your user (or their if you're a moderator) errors.
By the way, I just wanted to comment on this -

There is an actual "easy fix" for this. Simply count tags.

For each tag X, where [x] opens and [/x] closes, count every tag in between. Every open tag [y] increments the counter for [x] by 1, and every close tag [/y] decrements the counter.

If when [/x] closes from the tag count is not properly "0" - then reject the post, and give the user an error.

For nesting tags, this should simply be tracked from within each successful nesting.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Sun Jul 10, 2016 11:32 am

It's clearly a phpBB bug, then. The <div> spoiler might be a little messy, sure, but there's no reason it should be failing that epicly, either. In fact, I believe safeguards should have long been in place to prevent that.

What's happening is since the HTML-bugger-up is happening with crossing tags, the </div> from the spoiler is messing with the forum's own <div> code (which it uses by default to show every post) - so, as you'll see, the forum layout will be just fine if you switch to the subsilver2 style, since it uses tables instead of <div>s.

Honestly, with HTML5 you could just define custom tags such as <forumspoiler> and attach a style to them and be just fine. As long as <forumspoiler> is set to "display: block" in CSS, it can be used in place of <div> and it should work. There's some more info about that here.

Re: [Forum] Spoiler Layout Breakage

by NeuralStunner » Sun Jul 10, 2016 11:24 am

Eruanna wrote:You used a [ code ] block which by definition ignores BB Codes inside of it.
Well, this mess also fails gracefully (if you can call it that):

Code: Select all

[spoiler][list][quote][wiki][/quote][/spoiler][/wiki][/list]
Spoiler:
[/wiki][/list]

The spoiler code in use must be doing something very, um, "special" with divs.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Sun Jul 10, 2016 11:15 am

You used a [ code ] block which by definition ignores BB Codes inside of it. Some crossing of other internal codes is not handled quite as gracefully:

Code: Select all

[list][quote][*]test[/list][/quote]test

Re: [Forum] Spoiler Layout Breakage

by NeuralStunner » Sun Jul 10, 2016 8:16 am

Eruanna wrote:I thought phpBB had handling in place to prevent that - as far as I remember it used to produce Gez's output more than it ever produced what NeuralStunner linked.
It does with other tags:

Code: Select all

[/quote]
It seems to be Quote+Spoiler that doesn't quite work right.

I'm not sure what spoiler code is in use here, but I don't have this problem on my own forum. Crossing these tags as in the OP will actually produce a functional spoiler inside a quote, since both are set up to use <BLOCKQUOTE>.
Spoiler: Codes I'm using

Re: [Forum] Spoiler Layout Breakage

by Dark-Assassin » Sun Jul 10, 2016 6:41 am

It acts the same as crossing different HTML tags. It's not something that's going to be easily fixed. The best you can do is just fix your user (or their if you're a moderator) errors.

Re: [Forum] Spoiler Layout Breakage

by Rachael » Sun Jul 10, 2016 6:36 am

I thought phpBB had handling in place to prevent that - as far as I remember it used to produce Gez's output more than it ever produced what NeuralStunner linked.

Nevertheless, I think that's more of a phpBB bug than it is a ZDoom Forums bug. DRD Team acts a little weird when you cross the tags, too.

Re: [Forum] Spoiler Layout Breakage

by Gez » Sun Jul 10, 2016 1:49 am

Best case, the parser can be made strict enough that

Code: Select all

[quote][spoiler]Stuff[/quote][/spoiler]
would be rendered as:
Spoiler:
[∕spoiler]

(Since the forum doesn't let us use html entities, I had to cheat a bit with the closing spoiler tag slash.)

Re: [Forum] Spoiler Layout Breakage

by NeuralStunner » Sat Jul 09, 2016 4:49 pm

Yes, that's what I mean by "crossing tags".

Top