From d65b786b261cd2a3f98d72f9161bed3894358a1f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 7 Oct 2014 06:40:22 +0000 Subject: [PATCH] backport of Nathans r48904: trim email addresses to avoid validation errors --- etemplate/js/et2_widget_taglist.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/etemplate/js/et2_widget_taglist.js b/etemplate/js/et2_widget_taglist.js index e959389476..48c36c2ca9 100644 --- a/etemplate/js/et2_widget_taglist.js +++ b/etemplate/js/et2_widget_taglist.js @@ -495,6 +495,15 @@ var et2_taglist_email = et2_taglist.extend( selectionRenderer: function(item) { + // Trim + if(typeof item.id == 'string') + { + item.id = item.id.trim(); + } + if(typeof item.label == 'string') + { + item.label = item.label.trim(); + } // We check free entries for valid email, and render as invalid if it's not. var valid = item.id != item.label || et2_url.prototype.EMAIL_PREG.test(item.id || '');