Explorar o código

버그 수정

2DU %!s(int64=8) %!d(string=hai) anos
pai
achega
0eef96c398
Modificáronse 2 ficheiros con 3 adicións e 12 borrados
  1. 0 3
      app.py
  2. 3 9
      func.py

+ 0 - 3
app.py

@@ -1297,7 +1297,6 @@ def edit(name = None, name2 = None, num = None):
             for data_list in data:
                 match = re.compile(data_list[0])
                 if(match.search(request.forms.content)):
-                    print(data_list[1])
                     if(data_list[1] == 'X'):
                         rb_plus(conn, ip, '', get_time(), '도구:편집 필터', '편집 필터에 의한 차단')
                         curs.execute("insert into ban (block, end, why, band) values (?, '', ?, '')", [ip, '편집 필터에 의한 차단'])
@@ -1471,7 +1470,6 @@ def preview(name = None, num = None):
 
     ip = ip_check()
     can = acl_check(conn, name)
-    captcha = captcha_get(conn)
     
     if(can == 1):
         return(re_error(conn, '/ban'))
@@ -1491,7 +1489,6 @@ def preview(name = None, num = None):
                     <textarea rows="25" name="content">' + html.escape(request.forms.content) + '</textarea> \
                     <textarea style="display: none;" name="otent">' + html.escape(request.forms.otent) + '</textarea><hr> \
                     <input placeholder="사유" name="send" type="text"><hr> \
-                    ' + captcha + ' \
                     <button id="preview" class="btn btn-primary" type="submit">저장</button> \
                     <button id="preview" class="btn" type="submit" formaction="/preview/' + url_pas(name) + action + '">미리보기</button> \
                 </form><hr>' + enddata,

+ 3 - 9
func.py

@@ -25,7 +25,7 @@ def captcha_get(conn):
     curs = conn.cursor()
 
     data = ''
-    if(re.search('\.|:', ip_check()) and (not session.get('Awaken') or session.get('Awaken') != 1)):
+    if(re.search('\.|:', ip_check())):
         curs.execute('select data from other where name = "recaptcha"')
         recaptcha = curs.fetchall()
         if(recaptcha and recaptcha[0][0] != ''):
@@ -41,7 +41,7 @@ def captcha_post(response, conn, num = 1):
     curs = conn.cursor()
 
     if(num == 1):
-        if(re.search('\.|:', ip_check()) and (not session.get('Awaken') or session.get('Awaken') != 1) and captcha_get(conn) != ''):
+        if(re.search('\.|:', ip_check()) and captcha_get(conn) != ''):
             curs.execute('select data from other where name = "sec_re"')
             sec_re = curs.fetchall()
             if(sec_re and sec_re[0][0] != ''):
@@ -52,12 +52,6 @@ def captcha_post(response, conn, num = 1):
                 else:
                     json_data = data.json()
 
-                    try:
-                        json_data['error-codes']
-                        return(0)
-                    except:
-                        pass
-
                     if(data.status_code == 200 and json_data['success'] == True):
                         return(0)
                     else:
@@ -67,7 +61,7 @@ def captcha_post(response, conn, num = 1):
         else:
             return(0)
     else:
-        session['Awaken'] = 1
+        pass
 
 def skin_check(conn):
     curs = conn.cursor()