Editing a post converts tags to use < and > brackets and not [ and ] by Franpa at 8:07 AM EDT on October 9, 2012
When editing a post that contains tags like [small] and [ /small] the forum software will convert the tags to use < and > brackets so it looks like <small> and </small>.

The forum software doesn't recognize the latter tag formatting so this doesn't make much sense.

edited 8:09 AM EDT October 9, 2012
by hcs at 8:41 AM EDT on October 9, 2012
Well, they're meant to be used in pairs. I'm not sure I understand what the issue is.

Oh, I get it, the less than/greater than character code (& lt; & gt;) is being converted to a literal < >, and then the tag translation is being applied.

edited 8:48 AM EDT October 9, 2012

Yeah, the edit converter ought to be doing those operations in the reverse order, good catch. I hope that fixing this doesn't open up a new can of worms.

<small>small</small>

edited 9:04 AM EDT October 9, 2012

htmlspecialcharacters_decode is still a bit overzealous (it converts &amp;lt; all the way back to < in one pass, if you try to edit this &lt; will become <), but I think this is doing closer to what is reasonable now.

edited 9:08 AM EDT October 9, 2012

edited 9:11 AM EDT October 9, 2012

Never mind the htmlspecialcharacters_decode comment, for whatever reason I'd forgotten that the text edit form needs <> escaped like anything else.

edited 9:14 AM EDT October 9, 2012

edited 9:16 AM EDT October 9, 2012

Yeah so I think I'll just pull out the htmlspecialcharacters_decode altogether, someone could do something tricky with a </textarea> blah

edited 9:17 AM EDT October 9, 2012
"quotes still ok?"

edited 9:24 AM EDT October 9, 2012

edited 9:25 AM EDT October 9, 2012
by Franpa at 4:58 PM EDT on October 9, 2012
I'm not even aware if it is possible to do a quote on this forum lol. Aside from that yes, go ahead and do... what ever it is you are doing ;)

test

edited 4:58 PM EDT October 9, 2012

edited 4:58 PM EDT October 9, 2012

Appears to be working fine now! Great work! Yes I don't quite grasp the terms you are throwing around but I understand that you don't quite know exactly how to fix this issue and you have simply removed the conversion feature entirely for the time being?

edited 5:00 PM EDT October 9, 2012
by hcs at 1:11 AM EDT on October 10, 2012
Hm, I had typed up a long explanation but I realized that I'm still not 100% sure what issue you were encountering. The bug I found was that if you type <small>, it gets converted to [small], which sounds like the opposite of what you reported.

It was wrong anyway, and with some mismatched tags it may have looked like the other way 'round. The bottom line is that I shouldn't have been doing htmlspecialchars_decode anyway, it opened the door for a bit of XSS and broke a few things to boot.

edited 1:25 AM EDT October 10, 2012


Go to Page 0

Search this thread

Show all threads

Reply to this thread:

User Name Tags:

bold: [b]bold[/b]
italics: [i]italics[/i]
emphasis: [em]emphasis[/em]
underline: [u]underline[/u]
small: [small]small[/small]
Link: [url=http://www.google.com]Link[/url]

[img=https://www.hcs64.com/images/mm1.png]
Password
Subject
Message

HCS Forum Index
Halley's Comet Software
forum source