From 11cf1bfb6856f09b0123d2aeafa25abd6ef526b9 Mon Sep 17 00:00:00 2001 From: TOW Date: Fri, 29 Mar 2019 08:51:07 -0300 Subject: Arreglado bug en oekaki que permite postear dibujo donde sea --- cgi/oekaki.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'cgi') diff --git a/cgi/oekaki.py b/cgi/oekaki.py index f0bada7..14446d7 100644 --- a/cgi/oekaki.py +++ b/cgi/oekaki.py @@ -113,7 +113,7 @@ def oekaki(self, path_split): # path splits: # 3: Board # 4: Parentid - if path_split > 7: + if len(path_split) >= 5: # Al terminar de dibujar, llegamos aqui. Damos la opcion de postearlo. board = setBoard(path_split[3]) try: @@ -121,6 +121,9 @@ def oekaki(self, path_split): except: parentid = None + if board['allow_oekaki'] != '1': + raise UserError, 'Esta sección no soporta oekaki.' + ts = int(time.time()) ip = inet_aton(self.environ["REMOTE_ADDR"]) fname = "%s/oek_temp/%d.png" % (Settings.HOME_DIR, ip) @@ -144,7 +147,6 @@ def oekaki(self, path_split): timetaken = 0 page += renderTemplate("board.html", {"threads": None, "oek_finish": oek, "replythread": parentid, "ts": ts}) - elif path_split[2] == 'animation': try: board = setBoard(path_split[3]) -- cgit v1.2.1-18-gbd029