![]() |
PHP Tag Slashes String Parsing Fix
PHP Tag Slashes String Parsing Fix
(By Boofo) Thanks goes out to Firefly for not giving me an answer to my original request on how to fix this problem with the php tags. It forced me to figure it out for myself. ;) What this hack does: For anyone that uses php tags a lot, you'll know what this hack does. The phphighlite function does not handle slashes very well. And since only the php tags use that function, when you use the code tags there is no problem with the slashes being parsed right. This hack fixes that for any tags that use [ and ] (i.e. preg_replace statements). It has nothing to do with BBCode, but the way the php tags handle slashes (\). This hack keeps you from having to use \\\\[ to get a \[ in the php tags. Files to modify: 1 (functions.php) Templates to modify: None Templates to add: None Queries to run: None Install time: 1 minute Please click the install button if you find this hack useful. |
cool thanks
|
You're very welcome. ;)
|
Still doen't get the point. I do use uch php code. What's the matter? Is there a way, to embed php in templates? Filburt's hack does not works on 2.3
|
If you try to put something like:
$message[message] = trim(preg_replace("~\[quote\](.*)\[/quote\]~si", "", $message[message])); between php tags, you will have to change the \[ and \] to \\\[ and \\\] to make it parse right. With this hack, you no longer have to do that. The hack will automatically do this for you. |
Has vb.org fixed this... let's find out! ;)
PHP Code:
|
Chen fixed it here a while back. I decided to release my fix for it after I came across this problem on my site.
|
So Bob, this will fix any further additions to tags (that use slashes) correct? You won't have to change any former function strings i.e. preg_replace()? If so, you have my install. :)
|
This will take care of it. The only thing you might have to do is go back and take out any extra slashes you added before to make the code look right. If you never added any extra slashes, then you are all set. ;)
|
Only once, and it seems to be working fine now. Great fix Bob. :)
|
All times are GMT. The time now is 09:00 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|