commit 5f7e2d6: [Minor] Ical: Allow \r as line endings

Vsevolod Stakhov vsevolod at highsecure.ru
Wed Jan 13 15:21:06 UTC 2021


Author: Vsevolod Stakhov
Date: 2021-01-13 15:18:37 +0000
URL: https://github.com/rspamd/rspamd/commit/5f7e2d6ad83aaf1246fa83be2f4a0438323d1abc (HEAD -> master)

[Minor] Ical: Allow \r as line endings

---
 lualib/lua_content/ical.lua | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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


More information about the Commits mailing list