Forum Moderators: coopster
function html_allow($input) {
$symb = array(
'/&/',
"/[\\\\]{1}'/",
'/[\\\\]{1}"/',
'/</',
'/>/',
"/'/",
'/"/'
);
$repl = array(
'&',
''',
'"',
'<',
'>',
''',
'"'
);
$count = count($symb);
for($i = 0; $i < $count; $i++) {
$input = preg_replace($symb[$i], $repl[$i], $input)
}
$find = '/<(a|b|i|u|img|sup|sub|span)([^(>|onclick|ondblclick|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onkeydown|onkeypress|onkeyup)]+)>([^(<\/(1)>)]+)<\/(1)>/mis';
if(preg_match_all($bb_a_a[$i], $input, $out, PREG_PATTERN_ORDER)) {
$sym = array(
'/'/',
'/"/',
'/</',
'/>/'
);
$rep = array();
"'",
'"',
'<',
'>'
);
ksort($sym);
ksort($rep);
$count = count($out[0])
for($i = 0; $i < $count; $i++) {
$replace = preg_replace($sym, $rep, $out[0][$i]);
$input = str_ireplace($out[0][$i], $replace, $input);
} //for
} //if
return $input;
} //function