]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Ical: Allow \r as line endings
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Jan 2021 15:18:37 +0000 (15:18 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Wed, 13 Jan 2021 15:18:37 +0000 (15:18 +0000)
lualib/lua_content/ical.lua

index d5a49de2ba07ba64a135ec5e4ec1fe21febf80f4..5ee37a49107ee14610c9e61552c53bb293364aac 100644 (file)
@@ -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