Commit 3434ceea authored by Dan Bitzer's avatar Dan Bitzer

Fix email action validation when field uses "name <email>" format

parent 2d7914a5
Pipeline #903 passed with stages
in 1 minute and 44 seconds
......@@ -177,7 +177,8 @@ final class NF_Actions_Email extends NF_Abstracts_Action
$email = trim( $email );
if ( false !== strpos( $email, '<' ) && false !== strpos( $email, '>' ) ) {
preg_match('/(?:<)[^>]*(?:>)/', $email, $email);
$email = $email[ 1 ];
$email = $email[ 0 ];
$email = str_replace( [ '<', '>' ], '', $email );
}
if( ! is_email( $email ) ) {
$errors[ 'invalid_email' ] = sprintf( __( 'Your email action "%s" has an invalid value for the "%s" setting. Please check this setting and try again.', 'ninja-forms'), $action_settings[ 'label' ], $setting );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment