1

Topic: Another bug with quotes and BBcode

When urls are included in the quote tag, in the resulting HTML, the quotes in <a href=""> are improperly escaped with a backslash.

[quote="A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url]"]PunBB is delicious [i]and[/i] nutritious![/quote]
[quote=A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url]]PunBB is delicious [i]and[/i] nutritious![/quote]

results in:

A [url=http://en.wikipedia.org/]Wikipedia[/url] article on [url=http://en.wikipedia.org/wiki/PunBB]PunBB[/url] wrote:

PunBB is delicious and nutritious!

A [url=http://en.wikipedia.org/ wrote:

Wikipedia[/url] article on PunBB]PunBB is delicious and nutritious!

with the HTML:

<blockquote><div class="incqbox"><h4>A <a href=\"http://en.wikipedia.org/\">Wikipedia</a> article on <a href=\"http://en.wikipedia.org/wiki/PunBB\">PunBB</a> wrote:</h4><p>PunBB is delicious <em>and</em> nutritious!</p></div></blockquote>
<blockquote><div class="incqbox"><h4>A <a href=\"http://en.wikipedia.org/\">Wikipedia</a> article on <a href=\"http://en.wikipedia.org/wiki/PunBB\">PunBB</a> wrote:</h4><p>PunBB is delicious <em>and</em> nutritious!</p></div></blockquote>

Re: Another bug with quotes and BBcode

probably because you were never meant to put url tags in a quote tag name

3

Re: Another bug with quotes and BBcode

It was a fairly common practice at the forum I frequent before we switched from phpBB to punBB.  It's a convenient way of quoting an external source and identifying it at the same time.

Re: Another bug with quotes and BBcode

Like Connorhd pointed out, I never intended for people to do that, but nevertheless, I will look into it.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Another bug with quotes and BBcode

An alternitive to this situation could be making the quote without the links and then provide some explanation that the quote was from outside the topic and provide a link to wherever.

[img]http://forums.punbb.org/img/smilies/cool.png[/img]This is me.[img]http://forums.punbb.org/img/smilies/cool.png[/img]

6

Re: Another bug with quotes and BBcode

I understand that you never intended to be possible, but if that's the case, you should return some sort of BBCode parsing error ("The BBCode syntax in the message is incorrect.  No BBCode allowed inside [ quote=]") instead of allowing it to happen but then dealing with it badly.

Personally, I would prefer it if this were a feature?possibly it can be fixed with a single stripslashes() in the right place.  Still, it's technically better to have no support for it instead of support that is buggy (and non-functional).

I've also seen people use images instead of names, but this is far less common than using URLs in the names.  However, phpBB handles this correctly also.

[img wrote:

http://punbb.org/img/logo_1_light.png[/img]]This quote was made by an image

Re: Another bug with quotes and BBcode

Fixed

"Programming is like sex: one mistake and you have to support it for the rest of your life."