sanitize_user() fixes.

git-svn-id: http://svn.automattic.com/wordpress/trunk@3454 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
ryan 2006-01-18 05:37:26 +00:00
parent b6f368702d
commit 45863965f1
1 changed files with 6 additions and 1 deletions

View File

@ -266,7 +266,12 @@ function remove_accents($string) {
}
function sanitize_user( $username ) {
return preg_replace('|a-z0-9 _.-|i', '', $username);
$raw_username = $username;
$username = strip_tags($username);
// Kill octets
$username = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $username);
$username = preg_replace('/&.+?;/', '', $username); // Kill entities
return apply_filters('sanitize_user', $username, $raw_username);
}
function sanitize_title($title, $fallback_title = '') {