Page 1 of 2
The new [php] code
Posted: Tue Apr 11, 2006 5:28 am
by Grim...
The new code for posting PHP strips out escaping slashes.
These two bits of code are the same, but, obviously, only one of them looks like it will work:
Code: Select all
<?php
print "\"Hello\", said Grim...";
?>
Code: Select all
<?php
print "\"Hello\", said Grim..."; //d11 == fixed it?
?>
This is a bad thing, as demonstrated here:
viewtopic.php?p=254331
Re: The new [php] code
Posted: Tue Apr 11, 2006 7:01 am
by Chris Corbyn
Grim... wrote:The new code for posting PHP strips out escaping slashes.
These two bits of code are the same, but, obviously, only one of them looks like it will work:
Code: Select all
<?php
print ""Hello", said Grim...";
?>
Code: Select all
<?php
print ""Hello", said Grim...";
?>
This is a bad thing, as demonstrated here:
viewtopic.php?p=254331
Thanks... I'm starting to think Geshi was a bad idea

Posted: Tue Apr 11, 2006 9:20 am
by Maugrim_The_Reaper
http://geshi.org
Testing against latest 1.2 version of Geshi, the problem does not exist. Which version does the phpBB mod use anyway?
Posted: Tue Apr 11, 2006 10:13 am
by Chris Corbyn
Maugrim_The_Reaper wrote:http://geshi.org
Testing against latest 1.2 version of Geshi, the problem does not exist. Which version does the phpBB mod use anyway?
Hmm, it uses v1.2. Maybe I shouldn't be blaming Geshi but rather, the author of the mod
It'll just be something silly like he/she designed the mod with magic quotes on or something... not had a chance to look yet... really busy. Certain smilies also get parsed

Not seen any other issues thus far.
Posted: Tue Apr 11, 2006 11:26 am
by timvw
I can't reproduce the problem either... (I do seem to remember that the phpbb mod isn't supported anymore because of some differences of opinion...)
@version $Id: geshi.php,v 1.30 2006/02/25 00:46:33 oracleshinoda Exp $
define('GESHI_VERSION', '1.0.7.7');
Posted: Tue Apr 11, 2006 11:32 am
by Chris Corbyn
timvw wrote:I can't reproduce the problem either... (I do seem to remember that the phpbb mod isn't supported anymore because of some differences of opinion...)
@version $Id: geshi.php,v 1.30 2006/02/25 00:46:33 oracleshinoda Exp $
define('GESHI_VERSION', '1.0.7.7');
Code: Select all
* @package core
* @author Nigel McNie <nigel@geshi.org>
* @copyright Copyright © 2004, 2005, Nigel McNie
* @license http://gnu.org/copyleft/gpl.html GNU GPL
* @version $Id: geshi.php,v 1.2 2005/08/12 13:15:08 oracleshinoda Exp $
FYI the MOD we're using isn't the Geshi authors mod from the phpBB site. It's on sourceforge and is simply called "syntax"

Posted: Tue Apr 11, 2006 11:33 am
by timvw
Don't know.. I wrote my own simple plugin for wordpress that uses geshi.. And i wasn't able to reproduce the problem... That's why i blame it on the mod

Posted: Tue Apr 11, 2006 12:23 pm
by Benjamin
While we are talking about it, I just wanted to put in my 2 cents. The font being used isn't hinted (at least on Windows XP) which makes it difficult to read, especially with light colors. I recommend changing the font to something else.
Posted: Tue Apr 11, 2006 1:51 pm
by feyd
could easily be phpbb (or related) doing a second stripslashes() when not needed, as phpbb does one already.
Posted: Tue Apr 11, 2006 5:40 pm
by Chris Corbyn
Line 84 of functions_syntax.php
Code: Select all
$source = str_replace("\\\"", "\"", $source);
Just commented it out

There's other issues with this mod though. I'm starting to wonder if we should collectively write our own Geshi mod

Posted: Tue Apr 11, 2006 5:58 pm
by John Cartwright
If it is as bad as your saying, I'm all for it

Posted: Tue Apr 11, 2006 6:53 pm
by Benjamin
Just change the font and I'll be happy

Posted: Tue Apr 11, 2006 7:11 pm
by timvw
just borrow from the current
Code: Select all
tags and replace the 'body' with geshi->parse_code?
Posted: Wed Apr 12, 2006 2:40 am
by Chris Corbyn
agtlewis wrote:Just change the font and I'll be happy

This is the font right now:
Code: Select all
.syntax-code {
font-family: Courier, 'Courier New', sans-serif;
font-size: 12px;
color: #111111;
background-color: #FAFAFA;
border: #D1D7DC;
border-style: solid;
border-left-width: 1px;
border-width: 1px;
}
12px... ack! I'm guessing you're looking for a courier/monospace font (with em rather than px) ?
Posted: Wed Apr 12, 2006 2:42 am
by Chris Corbyn
timvw wrote:just borrow from the current
Code: Select all
tags and replace the 'body' with geshi->parse_code?[/quote]
At the moment we simply redirect parsing in [php ] tags to geshi_highlight() which is part of the mod. We could do what you're saying just for [php ] tags but the issue still affects all [syntax ] tags.