From c7fbfe21fbb1511ce253e86dec0ca7878ed33641 Mon Sep 17 00:00:00 2001 From: Laurie Montant Date: Tue, 16 Jan 2024 13:52:38 +0100 Subject: [PATCH] Modifs emalis 1601241352 --- ReflexUtils.ftl | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ReflexUtils.ftl b/ReflexUtils.ftl index d1e2569..a73c1fa 100644 --- a/ReflexUtils.ftl +++ b/ReflexUtils.ftl @@ -10,17 +10,18 @@ <#-- Split email reflex into json array string --> <#-- Example : splitemail "john.doe@hardis-group.com,; name@hardis-group.com" --> <#-- return "["john.doe@hardis-group.com","name@hardis-group.com"]" --> -<#-- ${splitEmailsIntoArray(emailReflex)} --> <#-- --------------------------------------------------------------------------------------- --> <#function splitEmailsIntoArray emails > <#local str = "["> -<#list emails?split(';|,| ',"r")?filter(l -> l != "") as email> +<#list emails?split(";|,| |à|/","r")?filter(l -> l != "") as email> +<#if email?matches("^[\\w-\\.]+@([\\w-]+\\.)+[\\w-]{2,4}$")> <#if str != "["> <#local str += ","> <#local str += "\""> <#local str += email> <#local str += "\""> + <#local str += "]"> <#return (str)>