Page 1 of 1
Old php tags should be deprecated
Posted: Wed Jun 16, 2010 11:37 am
by josh
If I type an old style
Code: Select all
tag I get a bunch of html entities. I realize this is semi-intended at one point because of upgrading, but at this point can the old tags & their corresponding behavior be dismantled? It is confusing for users :D
[php]
$this->test();
Re: Old php tags should be deprecated
Posted: Wed Jan 12, 2011 2:29 pm
by McInfo
I'm bumping this topic to raise awareness that [
syntax=php] tags should be used instead of [
php] tags because this issue still exists.
Sample [php][/php]
Code: Select all
<?php if (true) {
echo '<a href="http://nowhere/nothing.php">Link</a>';
} ?>
Sample [syntax=php][/syntax]
Code: Select all
<?php if (true) {
echo '<a href="http://nowhere/nothing.php">Link</a>';
} ?>
Re: Old php tags should be deprecated
Posted: Wed Jan 12, 2011 3:09 pm
by Benjamin
I don't know where in the code this is implemented. It may be a part of the same library we are using to add all the other tags. I'll look into it when I get a minute. Have I mentioned the phpBB codebase is psychotic?
Re: Old php tags should be deprecated
Posted: Wed Jan 12, 2011 4:15 pm
by mikosiko
maybe I'm wrong... but is not just matter of:
a) delete the row associated to the
Code: Select all
tag in the table bbcodes or
b) update that row with the same definitions that the tag [syntax] has, allowing in this way to don't break old post ?
Re: Old php tags should be deprecated
Posted: Thu Jan 13, 2011 1:59 pm
by josh
When I quote posts the code looks good, so in theory they should replace "
Code: Select all
" with "[syntax=php]" with a rewrite rule.
Re: Old php tags should be deprecated
Posted: Thu Jan 13, 2011 2:41 pm
by superdezign
While that could work, it would also replace
Code: Select all
with [syntax=php] right here, making me look as though I'm comparing [syntax=php] with [syntax=php]. While not a huge deal right now, who knows if it could be in the future. What if I was writing code that used an array with php as a key?
[syntax=php]$languages = array(
'asp' => 'okay',
'php' => 'awesome',
);
echo "PHP is $languages[php]";[/syntax]
Re: Old php tags should be deprecated
Posted: Thu Jan 13, 2011 3:16 pm
by josh
That would be true of find & replace, however with regex that would not even be a concern.
This will only match tags that have both been opened and closed. So if I write
it'll match the latter part. The only exception would be what I just wrote, putting a fully matched tag in code tags (not a big deal in my opinion).
IMO if you weigh the two choices, its clear we should do it. What's more embarrassing making it look like the wrong tag, or making it look like our community writes non compiling PHP code, heh..
Re: Old php tags should be deprecated
Posted: Fri Jan 14, 2011 12:03 am
by Benjamin
I took a brief look at the code and it appears that it uses the language such php, css, html, ini etc to look for a corresponding parser which is located as a file on disk based on the language name. I'm not able to spend much time on that right now so if anyone else wants to have a look feel free. I believe the geshi code for phpBB is easy to find.
Re: Old php tags should be deprecated
Posted: Fri Jan 14, 2011 11:17 am
by mikosiko
@benjamin:
Maybe you could attach the message_parser.php file in case somebody could take a look at it, also will help to know which phpbb mod was installed to implement Geshi... was bbGeshi_0.7.5 ?