sanitize_user() fixes.

git-svn-id: https://develop.svn.wordpress.org/trunk@3454 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2006-01-18 05:37:26 +00:00
parent 2083c8d0b9
commit d1e7e7e9b7
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 = '') {