mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2026-02-14 04:57:10 +00:00
fix _edit access loophole
This commit is contained in:
@@ -379,10 +379,11 @@ def editexpopage(request, path):
|
||||
o = open(filepath, "r", encoding="utf8")
|
||||
html = o.read()
|
||||
autogeneratedmatch = re.search(
|
||||
r"\<\!--\s*(.*?(Do not edit|It is auto-generated).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE
|
||||
r"\<\!--\s*(.*?(Do not edit|It is auto-generated|NOEDIT).*?)\s*--\>", html, re.DOTALL + re.IGNORECASE
|
||||
)
|
||||
if autogeneratedmatch:
|
||||
return HttpResponse(autogeneratedmatch.group(1))
|
||||
message = "\tThis page is either auto-generated, and so cannot be edited,\n\t\tor it is too complex to allow users to edit it safely. \n\n\t\tA safer means of updating this page is on the programmers' to-do list."
|
||||
return render(request, "errors/notice.html", {"message": message})
|
||||
m = re.search(r"(.*)<head([^>]*)>(.*)</head>(.*)<body([^>]*)>(.*)</body>(.*)", html, re.DOTALL + re.IGNORECASE)
|
||||
if m:
|
||||
filefound = True
|
||||
|
||||
Reference in New Issue
Block a user