Back to vBulletin 3.0 Add-Ons

Fix for problem posting HTML entities as plain text
Mod Version: 1.00, by Cap'n Steve

This modification is in the archives.
vB Version: 3.0.7 Rating: (1 vote - 5.00 average) Installs: 2
Released: 18 Apr 2005 Last Update: Never Downloads: 1
Not Supported  

HTML Entities Fix 1.0


What does this hack do?

The short explanation: It makes it so & entities aren't escaped when posting.

The long explanation: As you may know, HTML uses entities in the form of &(something); to represent certain characters. For example, & will show up as & in the browser. vBulletin escapes any of these that you post so they show up as plain text. However, to be compatible with languages other than English, any entities in the form of &#(number); can't be escaped. That means things like ' (that represents a '), can't be posted as plain text without inserting empty bbcode in the middle of it. That's an ugly workaround, so I came up with this hack. Now, if you want to post ', just post ' and it will show up properly in the browser.

Why would I want to use this?

Well, if your forum involves discussing HTML or programming, or perhaps making modifications for popular forum software, this will let your users post instructions with entities in a way that makes much more sense than the current way. (hint, hint)

EDIT: I guess we're not allowed to attach HTML files, so if you don't want to deal with the zipped file, here are the instructions:

In includes/functions.php find
PHP Code:
    $text preg_replace('/&(?!#[0-9]+;)/si''&'$text); // translates all non-unicode entities 
Replace that with
PHP Code:
    //##################### Start HTML Entities Hack ###############################
    
$text preg_replace('/&(?!#[0-9]+;|amp;)/si''&'$text); // translates all non-unicode (and non-ampersand) entities
    //##################### End HTML Entities Hack ############################### 

Download

This modification is archived and cannot be downloaded.

Similar Mods

Profile Enhancements Send html OR plain text emails per user vBulletin 3.6 Add-ons
Fix for problem posting HTML entities as plain text vBulletin 3.5 Add-ons

vblts.ru supports vBulletin®, 2022-2024