mirror of https://github.com/dirtbags/moth.git
Runtime fixes for entrypoint
This commit is contained in:
parent
a3869942cc
commit
8e8fd540f4
|
@ -87,9 +87,10 @@ def generate_html(ziphandle, puzzle, puzzledir, category, points, authors, files
|
||||||
points=points,
|
points=points,
|
||||||
body=puzzle.html_body(),
|
body=puzzle.html_body(),
|
||||||
file_content=file_content.getvalue(),
|
file_content=file_content.getvalue(),
|
||||||
authors=', '.join(authors)),
|
authors=', '.join(authors),
|
||||||
scripts='\n'.join(scripts),
|
scripts='\n'.join(scripts),
|
||||||
)
|
)
|
||||||
|
)
|
||||||
ziphandle.writestr(os.path.join(puzzledir, 'index.html'), html_content.getvalue())
|
ziphandle.writestr(os.path.join(puzzledir, 'index.html'), html_content.getvalue())
|
||||||
|
|
||||||
def build_category(categorydir, outdir):
|
def build_category(categorydir, outdir):
|
||||||
|
|
|
@ -11,7 +11,7 @@ local points = cgi.fields['p'] or ""
|
||||||
local answer = cgi.fields['a'] or ""
|
local answer = cgi.fields['a'] or ""
|
||||||
|
|
||||||
-- Defang category name; prevent directory traversal
|
-- Defang category name; prevent directory traversal
|
||||||
category = category:gsub("[^A-Za-z0-9]", "-")
|
category = category:gsub("[^A-Za-z0-9_]", "-")
|
||||||
|
|
||||||
-- Check answer
|
-- Check answer
|
||||||
local needle = points .. " " .. answer
|
local needle = points .. " " .. answer
|
||||||
|
|
Loading…
Reference in New Issue