From 297703490b956717aa99a0cc6f2074af3b5d2d83 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Fri, 13 Mar 2009 19:04:39 +0000 Subject: [PATCH] Fix regex function in sanitize_email(), see #9316 git-svn-id: https://develop.svn.wordpress.org/trunk@10777 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/formatting.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index 7d1c1a4109..7603b8bea1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -1516,8 +1516,7 @@ function sanitize_email( $email ) { // LOCAL PART // Test for invalid characters - $local = preg_replace( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', '', $local ); - if ( '' === $local ) { + if ( !preg_match( '/^[a-zA-Z0-9!#$%&\'*+\/=?^_`{|}~\.-]+$/', $local ) ) { return apply_filters( 'sanitize_email', '', $email, 'local_invalid_chars' ); }