Surplus_Up (2DU) пре 7 година
родитељ
комит
e807a5c69c
1 измењених фајлова са 14 додато и 1 уклоњено
  1. 14 1
      route/tool/func.py

+ 14 - 1
route/tool/func.py

@@ -832,8 +832,21 @@ def rd_plus(title, sub, date):
 def history_plus(title, data, date, ip, send, leng):
     curs.execute("select id from history where title = ? order by id + 0 desc limit 1", [title])
     id_data = curs.fetchall()
+
+    send = re.sub('\(|\)|<|>', '', send)
+
+    if len(send) > 128:
+        send = send[:128]
     
-    curs.execute("insert into history (id, title, data, date, ip, send, leng, hide) values (?, ?, ?, ?, ?, ?, ?, '')", [str(int(id_data[0][0]) + 1) if id_data else '1', title, data, date, ip, send, leng])
+    curs.execute("insert into history (id, title, data, date, ip, send, leng, hide) values (?, ?, ?, ?, ?, ?, ?, '')", [
+        str(int(id_data[0][0]) + 1) if id_data else '1',
+        title,
+        data,
+        date,
+        ip,
+        send,
+        leng
+    ])
 
 def leng_check(first, second):
     if first < second: