Skip to content

Commit 7b7e00c

Browse files
committed
General: Exclude modifier letters (lm) from user names if strict
Modifier letters are somewhat like combining characters; there's nothing inherently wrong about using them in usernames, but if we're string and exclude combining characters, then excluding modifiers makes sense.
1 parent 998c886 commit 7b7e00c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/wp-includes/formatting.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2153,7 +2153,7 @@ function sanitize_user( $username, $strict = false ) {
21532153

21542154
// If strict, remove reduce to letters and numbers.
21552155
if ( $strict ) {
2156-
$username = preg_replace( '|[^a-z0-9 _.\-@\p{L}\p{N}]|iu', '', $username );
2156+
$username = preg_replace( '|[^a-z0-9 _.\-@\p{Ll}\p{Lu}\p{Lo}\p{N}]|iu', '', $username );
21572157
}
21582158

21592159
$username = trim( $username );

0 commit comments

Comments
 (0)