The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
|
#1
|
|||
|
|||
Word Processors & vBulletin UTF-8 Stripped Posts (Possible Fix?)
Hi all, I'm fairly new to the inner workings of vBulletin and I found myself tackling a bug when users would post directly from MS Word or Appleworks. Now these programs have the SmartQuotes and AutoCorrect options and those seemed to be Windows 1252 encodings so when the user would enter their text with copy and paste, what was happening was the moment the post hit a non UTF-8 character, the rest of the post would get cut off. I didn't have much luck finding any help with some vBulletin googling. After a lot of searching around though I found a helpful post on the php forums. All it required I do was add the following bolded code in includes/class_core.php:
Code:
function htmlspecialchars_uni($text, $entities = true) { $text = mb_convert_encoding($text,"HTML-ENTITIES","auto"); return str_replace( // replace special html characters array('<', '>', '"'), array('<', '>', '"'), preg_replace( // translates all non-unicode entities '/&(?!' . ($entities ? '#[0-9]+' : '(#[0-9]+|[a-z]+)') . ';)/si', '&', $text ) ); } Thanks for any insight, orth |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|