Simplify sanitize_key() and use it in more places. see #14910

git-svn-id: https://develop.svn.wordpress.org/trunk@15635 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren
2010-09-20 15:28:58 +00:00
parent a6d9954621
commit df6d5550db
3 changed files with 4 additions and 8 deletions

View File

@@ -763,10 +763,6 @@ function sanitize_user( $username, $strict = false ) {
*/
function sanitize_key( $key ) {
$raw_key = $key;
$key = wp_strip_all_tags($key);
// Kill octets
$key = preg_replace('|%([a-fA-F0-9][a-fA-F0-9])|', '', $key);
$key = preg_replace('/&.+?;/', '', $key); // Kill entities
$key = preg_replace('|[^a-z0-9 _.\-@]|i', '', $key);