PDA

View Full Version : BBCode parsing problems in 2.0


MattR
Sat 24th Feb '01, 4:14pm
I hate regular expressions, especially long, complicated ones.

Anyway, I've been playing with 2.0 and for some reason the bbcode broke so that it's showing:
\\4 instead of something bold.

It's actually 1.1.5 code with the "new" bbcode dropped in (I've edited the tables and entries) so perhaps there's something else I'm missing ?

MattR
Sun 25th Feb '01, 4:32pm
no help? Pleeeeezzz! ;)

MattR
Wed 28th Feb '01, 2:08am
Do I need to whine a little bit more? :(

Mike Sullivan
Wed 28th Feb '01, 2:12am
Make sure you have double quotes on the replace argument.

Of course, I can't tell much else unless you show me some code.

MattR
Wed 28th Feb '01, 2:39am
The code is stock vB 2.0 b1 code... Did you guys change it in b2? If so then I need to re-download it (as soon as I can find my new keys--- I lost 'em).

I can only think that there is some code that is meant to use MySQL's \ escape character (Sybase doesn't use this to escape strings).

Contents of bbcodereplacement:

1> SELECT bbcodereplacement
2> FROM bbcode
3> GO | less
bbcodereplacement
-----------------------------------------------------------------------
<b>\\4</b>
<i>\\4</i>
<a href="mailto:\\4">\\4</a>
<a aref="mailto:\\5">\\7</a>
<font size="\\5">\\7</font>
<blockquote><smallfont>quote:</smallfont><hr>\\4<hr></blockquote>
<u>\\4</u><font color="\\5">\\7</font>


I tried using <b>\\\\4</b> but instead it spit out \\\\4. Any thoughts?

Mas*Mind
Wed 28th Feb '01, 6:05am
seems like a bug...

\\4 and \\7 should be {param}

\\5 should be {option}

I suggest you to report it in the bugs-area

MattR
Wed 28th Feb '01, 8:35am
Well I tried replacing \\4 with {param} and it spit out {parm} this time... grr. Mabye I should get my key resent to me so I can check out the b2 code?

Mike Sullivan
Wed 28th Feb '01, 1:49pm
Actually, {param} and {option} are just replaced -- not like they're usable in regex's. :)

And I didn't, knowingly change this in beta 2. :)

Mas*Mind
Wed 28th Feb '01, 3:36pm
Originally posted by mrogish
Well I tried replacing \\4 with {param} and it spit out {parm} this time... grr. Mabye I should get my key resent to me so I can check out the b2 code?

No, I meant they should be replaced to {param} and {option} in your database (not through the form in the cp)....seemed there went something wrong when you updated them or something..

MattR
Wed 28th Feb '01, 4:10pm
I did update them in the database. When I try and post the PHP code in on this post and then hit "submit" the page sits and sits and then times out? That is odd..

But what exactly could I be doing wrong with the code?

Mas*Mind
Thu 1st Mar '01, 5:36am
This is indeed a bug...try to modify some existing bbcodes in you control-panel, there are \4's and \5's showing up while they should be {param} and {option}

Wayne Luke
Thu 1st Mar '01, 10:32am
The {option} and {param} get replaced with those holder variables but they work just fine. I haven't tried creating a custom BBCode with multiple parameters like you did though so that could quite possibly cause a problem.

The other problem looks like a "addslashes" is out of place. However I don't have the same problem on my site and I Have create 7 different custom codes.