Skip to content

Commit

Permalink
Merge pull request #5544 from Automattic/fix/trailing-whitespace-emai…
Browse files Browse the repository at this point in the history
…l-forwarding

Domains: Strip trailing whitespace when setting up Email Forwarding
  • Loading branch information
klimeryk committed May 31, 2016
2 parents d654cf5 + 356ba39 commit bb13146
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,14 +219,15 @@ const EmailForwardingAddNew = React.createClass( {
onChange( event ) {
let { name, value } = event.target;

value = value.replace( /\s/g, '' );
if ( name === 'mailbox' ) {
// Removes the domain part
value = value.replace( /@.*/, '' );
value = value.replace( /@.*$/, '' );
}

this.formStateController.handleFieldChange( {
name,
value: value
value
} );
},

Expand Down

0 comments on commit bb13146

Please sign in to comment.