diff options
Diffstat (limited to 'zzcxz.cgi')
-rwxr-xr-x | zzcxz.cgi | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -165,15 +165,12 @@ local function parse_directive(line, directives) directives.redirect = redirect elseif directive == "set" then if args:match "^%s*$" then return end - local flagname = args:match "^%s*(%w+)%s*$" - local text = "" - if not flagname then - flagname, text = args:match "^%s*(%w+)%s*(%w+)%s*$" - if not flagname or not text or utf8.len(text) > 1000 then - return - end + local flagname, text = args:match "^%s*(%w+)%s*(.-)%s*$" + if not flagname then return end + text = text or "" + if utf8.len(flagname) > 150 or utf8.len(text) > 1000 then + return end - if utf8.len(flagname) > 150 then return end directives.flags_updated[flagname] = text flags[flagname] = text elseif directive == "unset" then @@ -350,7 +347,7 @@ map["^/g/(%w%w%w%w%w)$"] = function(p) for flagname, text in pairs(directives.flags_updated) do if text then table.insert(cookies, - ('flag_%s=%s; secure; max-age=999999999999') + ('flag_%s=%s; max-age=999999999999') :format(flagname, url_encode(text))) else -- clear the cookie by expiring it in the past |