Merge pull request #34 from jeromelebleu/unstable

[fix] Allow special characters in email adresses (fix #33)
This commit is contained in:
Le Kload 2015-02-16 23:48:20 +01:00
commit 06be1fa65a

View file

@ -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 = {}