Runtime fixes for entrypoint

This commit is contained in:
Neale Pickett 2017-10-25 12:41:16 -06:00
parent 242caa87cb
commit e3a2d83485
2 changed files with 8 additions and 7 deletions

View File

@ -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())

View File

@ -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