diff options
Diffstat (limited to 'custom/extensions/email-libravatar.lua')
| -rw-r--r-- | custom/extensions/email-libravatar.lua | 9 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
1 file changed, 6 insertions, 3 deletions
diff --git a/custom/extensions/email-libravatar.lua b/custom/extensions/email-libravatar.lua index 2b1fecd..3422dc1 100644 --- a/custom/extensions/email-libravatar.lua +++ b/custom/extensions/email-libravatar.lua @@ -79,9 +79,12 @@ local function normalize_email(email) if email == nil then return nil end - local inner = email:match("<(.*)>") - if inner ~= nil then - email = inner + -- The first "<" and the last ">" are found directly, because "<(.*)>" + -- backtracks to the end of the address from every "<" in it. + local open = email:find("<", 1, true) + local close = email:find(">[^>]*$") + if open and close and close > open then + email = email:sub(open + 1, close - 1) end email = trim(email):lower() if email == "" then |
