From 519072ea9f202e58ed7b0574a5696519504facab Mon Sep 17 00:00:00 2001 From: Ryan Boren Date: Thu, 21 Aug 2008 22:58:29 +0000 Subject: [PATCH] Consolidate contiguous whitespace in usernames git-svn-id: https://develop.svn.wordpress.org/trunk@8704 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 7c1839fa92..d55a6bd538 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -447,6 +447,9 @@ function sanitize_user( $username, $strict = false ) { if ( $strict ) $username = preg_replace('|[^a-z0-9 _.\-@]|i', '', $username); + // Consolidate contiguous whitespace + $username = preg_replace('|\s+|', ' ', $username); + return apply_filters('sanitize_user', $username, $raw_username, $strict); }