aboutsummaryrefslogtreecommitdiffstats
path: root/lualib/lua_selectors.lua
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-21 18:30:28 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2018-08-21 18:30:55 +0100
commit0acba683d88afbb8f47f0782d9a3493a599a21ce (patch)
tree8cec67776c27cba6999bbf34139ca5cfdc4d8886 /lualib/lua_selectors.lua
parentaab736f8df5b806b223643e809b10bc0e9a47aeb (diff)
downloadrspamd-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.lua4
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 * ")"