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