Code blocks occasionally have weird output

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
Ambush Commander
DevNet Master
Posts: 3698
Joined: Mon Oct 25, 2004 9:29 pm
Location: New Jersey, US

Code blocks occasionally have weird output

Post by Ambush Commander »

Something weird is happening to code blocks...

Code: Select all

$this->matrix = array(
  array(0, 0, 0),
  array(0, 0, 0),
  array(0, 0, 0)
);
The code is just

Code: Select all

$this->matrix = array(
  array(0, 0, 0),
  array(0, 0, 0),
  array(0, 0, 0)
);
Icky. Any idea what is happening?
User avatar
John Cartwright
Site Admin
Posts: 11470
Joined: Tue Dec 23, 2003 2:10 am
Location: Toronto
Contact:

Post by John Cartwright »

Yea I've brought that to the attention of the order moderators the other day and we've looking into possible causes..

Weird it is...
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Just got back from my weekend away, this is very odd, and clearly not a one-off :? Hmmm...
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

yeah that is kind of wierd, and i noticed it yesterday also, i wonder what it could be :?:
User avatar
Jenk
DevNet Master
Posts: 3587
Joined: Mon Sep 19, 2005 6:24 am
Location: London

Post by Jenk »

Someone update the regex/parser?

Only happens when you don't put the <?php at the begining of code block..

Code: Select all

<?php echo $var; ?>

Code: Select all

echo $var;
It would appear the replacement for

Code: Select all

in the parser is now set to:

Code: Select all

<table width="98%" cellspacing="1" cellpadding="3" border="0" align="center"><tr> 	  <td><span class="genmed"><b>PHP:</b></span></td>	</tr>	<tr>	  <td class="code">		<div style="height: 5em; width: 100%; overflow: auto;">		nt color="#000000"><span style="color: #0000BB;"><?php&nbsp;
To insert the <?php tag when the user neglects to insert it themselves. Guess they never got round to the end tag, nor removing the extra bit they copied in by mistake :P
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Post by JayBird »

Also happens if you start the code block with <?php, but there is whitespace before it

Code: Select all

<?php sdkjhdf ?>
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

How can I put php code in with out that comming up>
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

nickman013 wrote:How can I put php code in with out that comming up>
I wouldn't worry about it, hopefully we'll have this fixed soon. But to answer your question you make sure you have the opening and closing <?php ?> tags with no whitespace between them and the [ php] tags.

Code: Select all

[php]<?php

echo 'foo';

?>[/php]

Code: Select all

<?php

echo 'foo';

?>
User avatar
nickman013
Forum Regular
Posts: 764
Joined: Sun Aug 14, 2005 12:02 am
Location: Long Island, New York

Post by nickman013 »

aright cool.

i will do it that way until it is fixed.
User avatar
Chris Corbyn
Breakbeat Nuttzer
Posts: 13098
Joined: Wed Mar 24, 2004 7:57 am
Location: Melbourne, Australia

Post by Chris Corbyn »

Post Reply