Fix regex in sanitize_email(), props sambauers, see #9316

git-svn-id: https://develop.svn.wordpress.org/trunk@10783 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-03-14 01:35:47 +00:00
parent b114706bcb
commit a23fda87b3
1 changed files with 2 additions and 1 deletions

View File

@ -1516,7 +1516,8 @@ function sanitize_email( $email ) {
// LOCAL PART
// Test for invalid characters
if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) {
$local = preg_replace( '/[^a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]/', '', $local );
if ( '' === $local ) {
return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' );
}