Quote:
Originally Posted by Opserty
|
Right. Exactly.
I am trying to make one of my tags behave like a code tag, and not process ANY code inside of it (not bbcode, not html, etc).
Just so you know why, here's an example. When I post an in game help file of a new game feature, I want to be able to show it to my players in properly formatted form. Our help files make use of brackets very often, and right now, with HTML turned on, anything <inside of brackets> gets snipped in code tags. Here's an example:
Code:
USAGE: group - Check your group status.
group <message> - Speak to the members of your group.
group leave - Leave your group.
group follow <on/off> - Turn group following on or off.
group settings - Change your group settings.
(L) group form <name> - Form a group with an optional <name>
(L) group name <name> - Change the group name. Use remove to remove.
(L) group invite <player> - Invite someone to join your group.
(L) group boot <player> - Boot someone from your group.
(L) group leader <member> - Change the group leader.
(L) group disband - Disband your group.
This is the command interface for group management. The commands marked (L)
are leader only commands.
This works fine here, because html is turned off. But if HTML was turned on, everything inside <brackets> would be snipped and it would make the information very confusing and incorrect.
--------------- Added [DATE]1207222272[/DATE] at [TIME]1207222272[/TIME] ---------------
Quote:
Originally Posted by Opserty
/functions/class_bbcode.php around lines 1515 onwards, there are functions: - handle_bbcode_code() (You could probably run htmlspecialchars_uni() in this somewhere to output only in plain text),
- handle_bbcode_html()
- handle_bbcode_html_tag().
|
Your suggestion put me on the right path of investigation. In this seciton of
class_bbcode.php:
Quote:
/**
* Handles a [code] tag. Displays a preformatted string.
*
* @param string The code to display
*
* @return string HTML representation of the tag.
*/
|
Right after this line:
Code:
$code = $this->strip_front_back_whitespace($code, 1);
I added this line:
Code:
$code = htmlspecialchars_uni($code);
And now my code tags no longer process HTML inside of them.
Can you forsee any problem with this code hack for me?