',$text);
$text = str_replace("°",'°',$text);
$text = str_replace("²",'²',$text);
$text = str_replace("€",'€',$text);
$text = str_replace("¨",'¨',$text);
$text = str_replace("£",'£',$text);
$text = str_replace("¤",'¤',$text);
$text = str_replace("µ",'µ',$text);
$text = str_replace("§",'§',$text);
$text = str_replace("œ",'œ',$text);
$text = str_replace("<br>","\n",$text);
$text = str_replace("<br />","\n",$text);
$text = str_replace("é","é",$text);
$text = str_replace("è","è",$text);
$text = str_replace("ê","ê",$text);
$text = str_replace("ë","ë",$text);
$text = str_replace("à","à",$text);
$text = str_replace("â","â",$text);
$text = str_replace("ç","ç",$text);
$text = str_replace("ù","ù",$text);
$text = str_replace("û","û",$text);
$text = str_replace("ü","ü",$text);
$text = str_replace("ô","ô",$text);
$text = str_replace("ï","ï",$text);
return $text;
}
/**
* convertNeededTagsForEmail - Grabs some text with html tags and those which are important for display (
,
) convert accordingly
*
* @param string The input string
* @return string The output string
*/
function convertNeededTagsForEmail($text) {
$text = str_replace("
","\n",$text);
$text = str_replace("
","\n",$text);
$text = str_replace("
","\n",$text);
$text = str_replace("
","\n",$text);
$text = str_replace("
","\n",$text);
$text = str_replace("","\n - ",$text);
$text = str_replace("",'',$text);
$text = str_replace("",'',$text);
$text = str_replace("
","\n",$text);
$text = str_replace("\xc2\xa0",' ',$text);
return $text;
}
function unhtmlentities ($string) {
$trans_tbl = get_html_translation_table (HTML_SPECIALCHARS );
$trans_tbl = array_flip ($trans_tbl );
$res = strtr ($string ,$trans_tbl );
$res = str_replace(""",'"',$res);
return $res;
}
/**
* SanitizeHtml - Grabs some text with all kinds of html code and parses it to make it safe
*
* @param string The HTML Code
* @return string The HTML output
*/
function SanitizeHtml($input) {
$input = htmlspecialchars($input); // first strip all chars
$input=str_replace('&','&',$input);
$input=str_replace('"','"',$input);
$input=str_replace('/>','/>',$input);
$input=str_replace('">','">',$input);
$input=str_replace('</a>','',$input);
$input=str_replace('<strike>','',$input);
$input=str_replace('</strike>','',$input);
$input=str_replace('<sub>','',$input);
$input=str_replace('</sub>','',$input);
$input=str_replace('<span','',$input);
$input=str_replace('<font','',$input);
$input=str_replace('<hr>','
',$input);
$input=str_replace('<hr','
',$input);
$input=str_replace('<br />','
',$input);
$input=str_replace('<tbody>','',$input);
$input=str_replace('</tbody>','',$input);
$input=str_replace('<tr>','',$input);
$input=str_replace('</tr>','
',$input);
$input=str_replace('<td>','',$input);
$input=str_replace('</td>',' | ',$input);
$input=str_replace('<td','',$input);
$input=str_replace('<table','',$input);
$input=str_replace('<div>','',$input);
$input=str_replace('<div',' ',$input);
$input=str_replace('<u>',' ',$input);
$input=str_replace('<u ','',$input);
$input=str_replace('<p>','',$input);
$input=str_replace('</p>',' ',$input);
$input=str_replace('<p ',' ',$input);
$input=str_replace('</li>','',$input);
$input=str_replace('<ul>',' ',$input);
$input=str_replace('</ul>',' ',$input);
$input=str_replace('<ol>',' ',$input);
$input=str_replace('</ol>',' ',$input);
$input=str_replace('<blockquote>',' ',$input);
$input=str_replace('<blockquote','',$input);
$input=str_replace('<em>','',$input);
$input=str_replace('</em>','',$input);
$input=str_replace('<strong>','',$input);
$input=str_replace('</strong>','',$input);
$input=str_replace('<sup>','',$input);
$input=str_replace('</sup>','',$input);
$input=str_replace('<input ','',$input);
$input=str_replace('<a ','',$input);
$input=str_replace('</h1>','',$input);
$input=str_replace('<h2>','',$input);
$input=str_replace('</h2>','',$input);
$input=str_replace('<h3>','',$input);
$input=str_replace('</h3>','',$input);
$input=str_replace('<h4>','',$input);
$input=str_replace('</h4>','',$input);
$input=str_replace('<h5>','',$input);
$input=str_replace('</h5>','',$input);
$input=str_replace('<h6>','',$input);
$input=str_replace('</h6>','',$input);
$input=str_replace('<pre>','',$input);
$input=str_replace('</pre>',' ',$input);
$input=str_replace('<address>','',$input);
$input=str_replace('</address>','',$input);
$input=str_replace('<h1 ','',$input);
$input=str_replace('<param ','',$input);
$input=str_replace('<embed ',' |