From 7111e0bb83a74b25c0119d0179d3597f46a08469 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Tue, 7 Oct 2014 22:27:27 +0000 Subject: [PATCH] Change email regex to allow email addresses of the form "Ralf Becker " or "rb@stylite.de" * + '"Becker, Ralf" ' * + "'Becker, Ralf' " + * + "Ralf Becker " (contains comma outside " or ' enclosed block) * - "Becker < Ralf " (contains < ----------- " ---------------) @@ -33,7 +34,7 @@ class etemplate_widget_url extends etemplate_widget * * Same preg is in et2_widget_url Javascript class, but no \x00 allowed and /u modifier for utf8! */ - const EMAIL_PREG = "/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x01-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}>?$/iu"; + const EMAIL_PREG = "/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|\042[^\042]+)\s?<)?[^\x00-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}>?\042?$/iu"; /** * Validate input diff --git a/etemplate/js/et2_widget_url.js b/etemplate/js/et2_widget_url.js index 23915b99e2..e0a6f2a1ca 100644 --- a/etemplate/js/et2_widget_url.js +++ b/etemplate/js/et2_widget_url.js @@ -38,6 +38,7 @@ var et2_url = et2_textbox.extend( * + "" or "rb@stylite.de" * + '"Becker, Ralf" ' * + "'Becker, Ralf' " + * + "Ralf Becker " (contains comma outside " or ' enclosed block) * - "Becker < Ralf " (contains < ----------- " ---------------) @@ -48,7 +49,7 @@ var et2_url = et2_textbox.extend( * * Same preg is in etemplate_widget_url PHP class! */ - EMAIL_PREG: new RegExp(/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|)\s?<)?[^\x00-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}>?$/i), + EMAIL_PREG: new RegExp(/^(([^\042',<][^,<]+|\042[^\042]+\042|\'[^\']+\'|\042[^\042]+)\s?<)?[^\x00-\x20()<>@,;:\042\[\]]+@([a-z0-9ÄÖÜäöüß](|[a-z0-9ÄÖÜäöüß_-]*[a-z0-9ÄÖÜäöüß])\.)+[a-z]{2,6}>?\042?$/i), /** * @memberOf et2_url */