Page 1 of 1

Broken code tag?

Posted: Sat Jan 26, 2008 5:13 am
by JAM
viewtopic.php?f=1&t=78010&p=439570#p439570
I'm guessing I'm not the only one that spots the problem? 8O
Edit 1: Also, the code=php and php tags seems to automaticly add \r\n's while editing posts sometimes.
Edit 2: Especially when choosing to edit you own post. A new \r\n is added...

Test code=text:

Code: Select all

$foo = 'A variable with a single thing here: ' by JAM';
Test code=php:

Code: Select all

$foo = 'A variable with a single thing here: ' by JAM';
 
Test php:

Code: Select all

$foo = 'A variable with a single thing here: ' by JAM';
 

Re: Broken code tag?

Posted: Sat Jan 26, 2008 5:16 am
by Chris Corbyn
Hmmm... interesting. Unfortunately I suspect this is a GeSHi bug and not a bug with the BBCode itself.

Thanks for the heads up, we'll do some digging.

Code: Select all

$test = 'there\'s a quote in here';

Code: Select all

$test = 'there\'s a quote in here';

Code: Select all

$test = 'there\'s a quote in here';

Re: Broken code tag?

Posted: Sat Jan 26, 2008 5:20 am
by JAM
No, didn't think so either. I've modded phpbb3 for some o' months now and never had these issues myself, even after adding hombrew bbcode java/php/sql/aso snippets.
I do know however that the phpbb2-phptag-version of phpdn was 'slightly' (understatment of the year?) edited so I just thought that it were a phpbb3 version aswell somewhere. :D

Good luck tho! I'm sure it's a simple stupid thingy...

Re: Broken code tag?

Posted: Sat Jan 26, 2008 5:34 am
by Chris Corbyn
I reckon the guy who wrote the bbGeSHi mod has magic_quotes turned on and has blindly used stripslashes() somewhere.

Re: Broken code tag?

Posted: Sat Jan 26, 2008 11:03 am
by RobertGonzalez
You know what? I am almost certain that it does. I was using a WordPress GeSHi plugin that required addslashes in order to post PHP code correctly. I think you are right Chris.

Re: Broken code tag?

Posted: Sun Jan 27, 2008 1:17 am
by Kieran Huggins
has trouble with setting constants as well - I posted a class in the SwiftMailer forum and had to comment them out :-(

Not a big deal, just reporting!

Re: Broken code tag?

Posted: Tue Jan 29, 2008 8:33 am
by Ollie Saunders
With smilies disabled:

Code: Select all

foo(.8);

Re: Broken code tag?

Posted: Tue Jan 29, 2008 8:34 am
by Ollie Saunders
With smilies enabled:

Code: Select all

foo(.<!-- s8) --><img src=\"{SMILIES_PATH}/icon_cool.gif\" alt=\"8)\" title=\"Cool\" /><!-- s8) -->;

Re: Broken code tag?

Posted: Tue Jan 29, 2008 9:53 am
by Weirdan
ole wrote:With smilies disabled:

Code: Select all

foo(.8);
 
Ok, I see. I will bring this issue to light in moderator forums.

Re: Broken code tag?

Posted: Thu Jan 31, 2008 1:15 pm
by JAM
Also, this code while editing...
Image
...gives you this behavior. Not a biggie, but very annoying. Notice the first row of code, and missing space char?

Code: Select all

   $counter = count($questions);
    for ($i = 0; $i < $counter; $i++) {
        // more code

Code: Select all

 
    $counter = count($questions);
    for ($i = 0; $i < $counter; $i++) {
        // more code

Re: Broken code tag?

Posted: Wed May 07, 2008 9:36 am
by Verminox
^^ That does not look like a bug. That's something I'd expect, because you have 3 spaces before the first line there, not 4. Also, in the second code block you entered a newline after the [ code ] tag, so it showed up empty. I usually put the <?php ?> tags alongside the [ code ] blocks

Code: Select all

<?php
$var = 'value';
?>
Gives best results:

Code: Select all

<?php
$var = 'value';
?>