Page 1 of 1

CODE tag erroneously strips backslash (*FIXED*)

Posted: Mon Nov 30, 2009 12:03 pm
by ridgerunner
I am active in the regex forum and frequently use the BBCode CODE=TEXT tag to post regex solutions. I recently discovered that for a CODE tag, the BBCode parser erroneously strips any backslash preceding a single quote. It is my understanding that anything placed inside a CODE tag should not be processed (i.e. changed) in any way. This "un-escaping escaped single quotes" behaviour makes it impossible to reliably post accurate PHP code.

Here is a test post:

Code: Select all

'No escape'
\'One escape\'
\\'Two escapes\\'
\\\'Three escapes\\\'
\\\\'Four escapes\\\\' 
In my view this is a pretty serious bug!

Edit: The bug is fixed. Changed thread title to indicate this.

Re: CODE tag erroneously strips backslash from single quote

Posted: Mon Nov 30, 2009 6:12 pm
by ridgerunner
I just checked stock installations of PhpBB (versions 2.0.23 and 3.0.5), and both versions properly handle escaped single quotes within a CODE tag. The bug must therefore be due to local DevNetwork modifications.

Re: CODE tag erroneously strips backslash from single quote

Posted: Thu Feb 11, 2010 12:18 pm
by ridgerunner
Bump.
Hey whoever is running this forum... This is a pretty serious BUG. Please fix!

Re: CODE tag erroneously strips backslash from single quote

Posted: Mon Mar 29, 2010 4:00 pm
by ridgerunner
Looks like the new forum format fixed this bug. (Now I need to go back and review/edit posts where I had to add an extra backslash...)

Thanks for the fix! :)