CODE tag erroneously strips backslash (*FIXED*)

We know you have an opinion on how things should be run around here. These are suggestions for the forums, and the website.This forum is not a place to ask for suggestions to your own coding (or otherwise) problems.

Moderator: General Moderators

Post Reply
User avatar
ridgerunner
Forum Contributor
Posts: 214
Joined: Sun Jul 05, 2009 10:39 pm
Location: SLC, UT

CODE tag erroneously strips backslash (*FIXED*)

Post 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.
Last edited by ridgerunner on Mon Mar 29, 2010 4:03 pm, edited 2 times in total.
User avatar
ridgerunner
Forum Contributor
Posts: 214
Joined: Sun Jul 05, 2009 10:39 pm
Location: SLC, UT

Re: CODE tag erroneously strips backslash from single quote

Post 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.
User avatar
ridgerunner
Forum Contributor
Posts: 214
Joined: Sun Jul 05, 2009 10:39 pm
Location: SLC, UT

Re: CODE tag erroneously strips backslash from single quote

Post by ridgerunner »

Bump.
Hey whoever is running this forum... This is a pretty serious BUG. Please fix!
User avatar
ridgerunner
Forum Contributor
Posts: 214
Joined: Sun Jul 05, 2009 10:39 pm
Location: SLC, UT

Re: CODE tag erroneously strips backslash from single quote

Post 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! :)
Post Reply