Bläddra i källkod

잡다한 패치

잉여개발기 (SPDV) 5 år sedan
förälder
incheckning
d473a99fdc
3 ändrade filer med 24 tillägg och 17 borttagningar
  1. 11 11
      route/give_acl.py
  2. 9 3
      route/tool/func.py
  3. 4 3
      route/user_custom_head_view.py

+ 11 - 11
route/give_acl.py

@@ -142,17 +142,17 @@ def give_acl_2(conn, name):
                 </ul>
             '''
 
-            if check_ok == '':
-                if acl_data:
-                    data += '' + \
-                        '<hr class="main_hr">' + \
-                        '<input value="' + html.escape(acl_data[0][1]) + '" placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>' + \
-                    ''
-                else:
-                    data += '' + \
-                        '<hr class="main_hr">' + \
-                        '<input placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>' + \
-                    ''
+            if acl_data:
+                data += '' + \
+                    '<hr class="main_hr">' + \
+                    '<input value="' + html.escape(acl_data[0][1]) + '" placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>' + \
+                ''
+            else:
+                data += '' + \
+                    '<hr class="main_hr">' + \
+                    '<input placeholder="' + load_lang('why') + '" name="why" type="text" ' + check_ok + '>' + \
+                ''
+                
 
         return easy_minify(flask.render_template(skin_check(),
             imp = [name, wiki_set(), custom(), other2(['(' + load_lang('acl') + ')', 0])],

+ 9 - 3
route/tool/func.py

@@ -340,7 +340,7 @@ def captcha_get():
                     data += '' + \
                         '<script src="https://www.google.com/recaptcha/api.js" async defer></script>' + \
                         '<div class="g-recaptcha" data-sitekey="' + recaptcha[0][0] + '"></div>' + \
-                        '<hr class=\"main_hr\">' + \
+                        '<hr class="main_hr">' + \
                     ''
                 else:
                     data += '' + \
@@ -453,9 +453,15 @@ def ip_warring():
         curs.execute(db_change('select data from other where name = "no_login_warring"'))
         data = curs.fetchall()
         if data and data[0][0] != '':
-            text_data = '<span>' + data[0][0] + '</span><hr class=\"main_hr\">'
+            text_data = '' + \
+                '<span>' + data[0][0] + '</span>' + \
+                '<hr class="main_hr">' + \
+            ''
         else:
-            text_data = '<span>' + load_lang('no_login_warring') + '</span><hr class=\"main_hr\">'
+            text_data = '' + \
+                '<span>' + load_lang('no_login_warring') + '</span>' + \
+                '<hr class="main_hr">' + \
+            ''
     else:
         text_data = ''
 

+ 4 - 3
route/user_custom_head_view.py

@@ -6,16 +6,17 @@ def user_custom_head_view_2(conn):
     ip = ip_check()
 
     if flask.request.method == 'POST':
+        get_data = flask.request.form.get('content', '')
         if ip_or_user(ip) == 0:
             curs.execute(db_change("select user from custom where user = ?"), [ip + ' (head)'])
             if curs.fetchall():
-                curs.execute(db_change("update custom set css = ? where user = ?"), [flask.request.form.get('content', None), ip + ' (head)'])
+                curs.execute(db_change("update custom set css = ? where user = ?"), [get_data, ip + ' (head)'])
             else:
-                curs.execute(db_change("insert into custom (user, css) values (?, ?)"), [ip + ' (head)', flask.request.form.get('content', None)])
+                curs.execute(db_change("insert into custom (user, css) values (?, ?)"), [ip + ' (head)', get_data])
 
             conn.commit()
 
-        flask.session['head'] = flask.request.form.get('content', None)
+        flask.session['head'] = get_data
 
         return redirect('/custom_head')
     else: