From 617723cdbe8ce04ea99595fd82091af7744bedcc Mon Sep 17 00:00:00 2001 From: james Date: Thu, 3 Dec 2009 21:13:31 +0000 Subject: [PATCH] A few more common html entities to convert to text --- common.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/common.inc.php b/common.inc.php index c1265b0..2a3d643 100644 --- a/common.inc.php +++ b/common.inc.php @@ -1274,8 +1274,15 @@ function getTextFromHtml($html) { $text=eregi_replace('',chr(13).chr(10),$text); //and strip the rest of the tags $text=strip_tags($text); - //and replace   + + //a few common html entities + //replace & with & first, so multiply-encoded entities will decode (like "&#160;") + $text=str_replace("&","&",$text); $text=str_replace(" "," ",$text); + $text=str_replace(" "," ",$text); + $text=str_replace("<","<",$text); + $text=str_replace(">",">",$text); + return $text; }