Hace algún tiempo ya había comentado que este tipo de funciones en general son de poca utilidad y dan una falsa sensación de seguridad a los que las usan.

function antiinjection($str) {
	$banwords = array ("'", ",", ";", "--", " or ", ")", "(", " OR ", " and ", " AND ","\n","\r");
	if ( eregi ( "[a-zA-Z0-9]+", $str ) ) {
		$str = str_replace ( $banwords, '', ( $str ) );
	} else {
		$str = NULL;
	}
	$str = trim($str);
	$str = strip_tags($str);
	$str = stripslashes($str);
	$str = addslashes($str);
	$str = htmlspecialchars($str);
	return $str;
}

¿Qué problemas le encuentran al código mostrado?