Public feed #604399

Mine

public text v1 · immutable
Raw Edit
·published 2007-07-05 14:31 UTC
rendered paste body
function bb_user_sanitize( $text, $strict = false ) {
	$raw = $text;
	if ( $strict ) {
		$text = preg_replace('/[^a-z0-9-]/i', '', $text);
		$text = preg_replace('|-+|', '-', $text);
	} else
		$text = preg_replace('/[^a-z0-9_-]/i', '', $text); // For backward compatibility.
	return apply_filters( 'bb_user_sanitize', $text, $raw, $strict );
}