From: Vsevolod Stakhov Date: Tue, 21 Aug 2018 17:30:28 +0000 (+0100) Subject: [Minor] Allow double quotes in selectors arguments and escapes X-Git-Tag: 1.8.0~223 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0acba683d88afbb8f47f0782d9a3493a599a21ce;p=thirdparty%2Frspamd.git [Minor] Allow double quotes in selectors arguments and escapes --- diff --git a/lualib/lua_selectors.lua b/lualib/lua_selectors.lua index 7a14340ec0..3efdfe1236 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 * ")"