From: Vsevolod Stakhov Date: Wed, 13 Jan 2021 15:18:37 +0000 (+0000) Subject: [Minor] Ical: Allow \r as line endings X-Git-Tag: 3.0~767 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5f7e2d6ad83aaf1246fa83be2f4a0438323d1abc;p=rspamd.git [Minor] Ical: Allow \r as line endings --- diff --git a/lualib/lua_content/ical.lua b/lualib/lua_content/ical.lua index d5a49de2b..5ee37a491 100644 --- a/lualib/lua_content/ical.lua +++ b/lualib/lua_content/ical.lua @@ -23,7 +23,7 @@ local ical_grammar local function gen_grammar() if not ical_grammar then local wsp = l.S(" \t\v\f") - local crlf = l.P"\r"^-1 * l.P"\n" + local crlf = (l.P"\r"^-1 * l.P"\n") + l.P"\r" local eol = (crlf * #crlf) + (crlf - (crlf^-1 * wsp)) local name = l.C((l.P(1) - (l.P":"))^1) / function(v) return (v:gsub("[\n\r]+%s","")) end local value = l.C((l.P(1) - eol)^0) / function(v) return (v:gsub("[\n\r]+%s","")) end