Boofo
06-08-2003, 10:00 PM
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.
(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.