From 1d44e53f7b8806b1fc6a8772670421221afa58de Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Mon, 16 Feb 2015 16:31:21 +0100 Subject: [PATCH] [fix] Allow special characters in email adresses (fix #33) --- helpers.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/helpers.lua b/helpers.lua index f8d2b8a..a9a0a63 100644 --- a/helpers.lua +++ b/helpers.lua @@ -592,7 +592,8 @@ function edit_user () ldap:close() local rex = require "rex_pcre" - local mail_re = rex.new([[^[\w\.\-]+@([^\W_A-Z]+([\-]*[^\W_A-Z]+)*\.)+([^\W\d_]{2,})$]], rex.flags().UTF8) + local rex_flags = rex.flags() + local mail_re = rex.new([[^[\w\.-+%]+@([^\W_A-Z]+([\-]*[^\W_A-Z]+)*\.)+([^\W\d_]{2,})$]], rex_flags.UTF8 + rex_flags.UCP) local mails = {}