2du 4 tahun lalu
induk
melakukan
403be128c8
6 mengubah file dengan 21 tambahan dan 17 penghapusan
  1. 5 7
      route/edit.py
  2. 1 1
      route/edit_delete.py
  3. 1 1
      route/edit_move.py
  4. 2 2
      route/edit_revert.py
  5. 11 5
      route/tool/func.py
  6. 1 1
      version.json

+ 5 - 7
route/edit.py

@@ -25,19 +25,17 @@ def edit(name = 'Test', name_load = 0, section = 0):
             else:
                 captcha_post('', 0)
     
-            if slow_edit_check() == 1:
+            if do_edit_slow_check() == 1:
                 return re_error('/error/24')
     
             today = get_time()
             content = flask.request.form.get('content', '').replace('\r\n', '\n')
             send = flask.request.form.get('send', '')
             
-            if edit_filter_do(content) == 1:
+            if do_edit_filter(content) == 1:
                 return re_error('/error/21')
-            
-            curs.execute(db_change('select data from other where name = "edit_bottom_compulsion"'))
-            db_data = curs.fetchall()
-            if db_data and db_data[0][0] != '' and send == '':
+
+            if do_edit_send_check(send) == 1:
                 return re_error('/error/37')
 
             curs.execute(db_change('select data from other where name = "copyright_checkbox_text"'))
@@ -125,7 +123,7 @@ def edit(name = 'Test', name_load = 0, section = 0):
             ''
     
             b_text = get_edit_text_bottom()
-            cccb_text = get_edit_text_bottom_check()
+            cccb_text = get_edit_text_bottom_check_box()
     
             curs.execute(db_change('select data from other where name = "edit_help"'))
             sql_d = curs.fetchall()

+ 1 - 1
route/edit_delete.py

@@ -18,7 +18,7 @@ def edit_delete(name):
             else:
                 captcha_post('', 0)
 
-            if slow_edit_check() == 1:
+            if do_edit_slow_check() == 1:
                 return re_error('/error/24')
 
             curs.execute(db_change("select data from data where title = ?"), [name])

+ 1 - 1
route/edit_move.py

@@ -17,7 +17,7 @@ def edit_move(name):
             else:
                 captcha_post('', 0)
 
-            if slow_edit_check() == 1:
+            if do_edit_slow_check() == 1:
                 return re_error('/error/24')
 
             curs.execute(db_change("select title from history where title = ?"), [move_title])

+ 2 - 2
route/edit_revert.py

@@ -19,13 +19,13 @@ def edit_revert(name):
             else:
                 captcha_post('', 0)
 
-            if slow_edit_check() == 1:
+            if do_edit_slow_check() == 1:
                 return re_error('/error/24')
 
             curs.execute(db_change("select data from history where title = ? and id = ?"), [name, str(num)])
             data = curs.fetchall()
             if data:
-                if edit_filter_do(data[0][0]) == 1:
+                if do_edit_filter(data[0][0]) == 1:
                     return re_error('/error/21')
 
             curs.execute(db_change("delete from back where link = ?"), [name])

+ 11 - 5
route/tool/func.py

@@ -1659,13 +1659,11 @@ def ip_pas(raw_ip, type_data = 0):
         
 # Func-edit
 def get_edit_text_bottom():
-    curs = conn.cursor()
-    
     curs.execute(db_change('select data from other where name = "edit_bottom_text"'))
     sql_d = curs.fetchall()
     return ('<hr class="main_hr">' + sql_d[0][0]) if sql_d and sql_d[0][0] != '' else ''
 
-def get_edit_text_bottom_check():
+def get_edit_text_bottom_check_box():
     curs = conn.cursor()
     
     cccb_text = ''
@@ -1681,7 +1679,15 @@ def get_edit_text_bottom_check():
         
     return cccb_text
 
-def slow_edit_check():
+def do_edit_send_check(data):
+    curs.execute(db_change('select data from other where name = "edit_bottom_compulsion"'))
+    db_data = curs.fetchall()
+    if db_data and db_data[0][0] != '' and data == '':
+        return 1
+    
+    return 0
+
+def do_edit_slow_check():
     curs = conn.cursor()
 
     curs.execute(db_change("select data from other where name = 'slow_edit'"))
@@ -1706,7 +1712,7 @@ def slow_edit_check():
 
     return 0
 
-def edit_filter_do(data):
+def do_edit_filter(data):
     curs = conn.cursor()
 
     if admin_check(1) != 1:

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.4.5 (stable1) (beta1) (dev4)",
+        "r_ver" : "v3.4.5 (stable1) (beta1) (dev5)",
         "c_ver" : "3500106",
         "s_ver" : "3500110"
     }