Fix & with bleach

This commit is contained in:
Andrew 2022-09-07 14:55:40 -04:00
parent 1b2fef06fb
commit df7d10886e
2 changed files with 7 additions and 7 deletions

View File

@ -104,7 +104,7 @@ class BaseHandler(tornado.web.RequestHandler):
strip: bool = True,
) -> t.Optional[str]:
arg = self._get_argument(name, default, self.request.arguments, strip)
return self.autobleach(name, arg)
return self.autobleach(name, arg).replace("&", "&")
def get_arguments(self, name: str, strip: bool = True) -> t.List[str]:
if not isinstance(strip, bool):

View File

@ -1727,7 +1727,7 @@ class PanelHandler(BaseHandler):
if interval_type == "days":
sch_time = bleach.clean(self.get_argument("time", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":
@ -1743,7 +1743,7 @@ class PanelHandler(BaseHandler):
delay = bleach.clean(self.get_argument("delay", None))
parent = bleach.clean(self.get_argument("parent", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":
@ -1763,7 +1763,7 @@ class PanelHandler(BaseHandler):
return
action = bleach.clean(self.get_argument("action", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":
@ -1889,7 +1889,7 @@ class PanelHandler(BaseHandler):
if interval_type == "days":
sch_time = bleach.clean(self.get_argument("time", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":
@ -1904,7 +1904,7 @@ class PanelHandler(BaseHandler):
delay = bleach.clean(self.get_argument("delay", None))
parent = bleach.clean(self.get_argument("parent", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":
@ -1924,7 +1924,7 @@ class PanelHandler(BaseHandler):
return
action = bleach.clean(self.get_argument("action", None))
if action == "command":
command = bleach.clean(self.get_argument("command", None))
command = self.get_argument("command", None)
elif action == "start":
command = "start_server"
elif action == "stop":