1 (edited by andrenth 2005-04-02 22:09)

Topic: bbcode handling bug

Hello. There's a bug related to unclosed bbcode tags. If I post the following (I added spaces to the tags can be visualized):

[ code ][ code ][ /code ]

I get the error below:

Notice: Undefined offset: 1 in <path>/include/parser.php on line 242
Call Stack
#    Function    Location
1    {main}()    /home/vusers/forums.bsdnexus.com/htdocs/viewtopic.php:0
2    parse_message()    /home/vusers/forums.bsdnexus.com/htdocs/viewtopic.php:298
3    split_text()    /home/vusers/forums.bsdnexus.com/htdocs/include/parser.php:383

This is on 1.2.4.

Regards,
Andre

Re: bbcode handling bug

[code]
works fine for me

3

Re: bbcode handling bug

humm tryed it in my forum to and it work ok

4 (edited by andrenth 2005-04-02 22:57)

Re: bbcode handling bug

[code]
hmm weird... here's a screenshot so that you guys don't thing i'm crazy tongue

http://sneakymustard.com/images/punbb.png

Are you also using 1.2.4?

5

Re: bbcode handling bug

I get this in 1.2.4 and 1.3dev
Notice: Undefined offset: 1 in f:\wamp\www\pun12\include\parser.php on line 242

If I try it with quote tags instead then I get an error message about invalid bbcode which is what should happen.

Re: bbcode handling bug

yeh even though it appears to work here it shouldn't wink

Re: bbcode handling bug

http://forums.indocron.net/viewtopic.php?id=343

Its happens to me on mine..

Indocron
$theQuestion = (2*b) || !(2*b);

Re: bbcode handling bug

I will look into it smile

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

Re: bbcode handling bug

I think this should fix it:

http://dev.punbb.org/changeset/161

With this code change, PunBB won't allow you to post a code block containing a new code tag. It's the easiest solution to the problem. Much of PunBB's BBCode system relies on the fact that whatever is in the database is valid BBCode.

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

10

Re: bbcode handling bug

        if (isset($temp[1])) $outside[] = $temp[1];

instead of

        $outside[] = $temp[1];

at line 242 of parser.php helped me.

Re: bbcode handling bug

That was the first thing I tried yesterday, but I ran into some problems. I'm not sure what the problem was, but I believe that means it will simply strip out the contents of the code box.

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