diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-21 18:30:28 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2018-08-21 18:30:55 +0100 |
commit | 0acba683d88afbb8f47f0782d9a3493a599a21ce (patch) | |
tree | 8cec67776c27cba6999bbf34139ca5cfdc4d8886 /lualib/lua_selectors.lua | |
parent | aab736f8df5b806b223643e809b10bc0e9a47aeb (diff) | |
download | rspamd-0acba683d88afbb8f47f0782d9a3493a599a21ce.tar.gz rspamd-0acba683d88afbb8f47f0782d9a3493a599a21ce.zip |
[Minor] Allow double quotes in selectors arguments and escapes
Diffstat (limited to 'lualib/lua_selectors.lua')
-rw-r--r-- | lualib/lua_selectors.lua | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 7a14340ec..3efdfe123 100644 --- a/lualib/lua_selectors.lua +++ b/lualib/lua_selectors.lua @@ -455,7 +455,9 @@ local function make_grammar() local l = require "lpeg" local spc = l.S(" \t\n")^0 local atom = l.C((l.R("az") + l.R("AZ") + l.R("09") + l.S("_-"))^1) - local argument = atom + (l.P("'") * l.C((1-l.S("'"))^0) * l.P("'")) + local singlequoted_string = l.P "'" * l.C(((1 - l.S "'\r\n\f\\") + (l.P'\\' * 1))^0) * "'" + local doublequoted_string = l.P '"' * l.C(((1 - l.S'"\r\n\f\\') + (l.P'\\' * 1))^0) * '"' + local argument = atom + singlequoted_string + doublequoted_string local dot = l.P(".") local obrace = "(" * spc local ebrace = spc * ")" |