MyBB Community Forums

Full Version: How to disable HTML in CODE tag?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi,I would like to know how to disable html support for CODE tag?
I don't want to disable html at all,just for code tag.
Thanks.
1. Open ./inc/class_parser.php in a text editor.

2. Find (around line 741):

$code = str_replace("  ", '  ', $code);

3. Add afterwards:

$code = htmlentities($code);

I just hope you know the risks of enabling HTML in your forum. It's a huge security risk.
I want to show the html code and method above just corrupts the code.
How so? Works fine for me. Would you mind explaining?

Your forum's URL would also help.
My guess would be a lot of   in the code... Wink
Yes,lot of   or <
Hi! I`m made:
Quote:"$code = htmlentities($code); "
as You said and get:
Quote:Warning [2] preg_replace() [function.preg-replace]: Compilation failed: missing terminating ] for character class at offset 15 - Line: 342 - File: inc/class_parser.php PHP 5.2.17 (Linux)
Backup of base not help.Confused