Browse Source

버그 수정

2DU 8 năm trước cách đây
mục cha
commit
e7d796d0e1
2 tập tin đã thay đổi với 10 bổ sung1 xóa
  1. 6 1
      func.py
  2. 4 0
      mark.py

+ 6 - 1
func.py

@@ -99,7 +99,12 @@ def include_check(name, data):
         curs.execute("select link from back where title = ? and type = 'include'", [name])
         back = curs.fetchall()
         for back_p in back:
-            namumark(back_p[0], data, 1, 1)  
+            curs.execute("select data from data where title = ?", [back_p[0]])
+            data = curs.fetchall()
+            if(data):
+                curs.execute("delete from back where link = ?", [back_p[0]])
+                curs.execute("delete from cat where cat = ?", [back_p[0]])
+                namumark(back_p[0], data[0][0], 1, 0)
     
 def login_check():
     session = request.environ.get('beaker.session')

+ 4 - 0
mark.py

@@ -738,6 +738,10 @@ def namumark(title, data, num, in_c):
                         clas = ''
                     else:
                         clas = 'not_thing'
+
+                    if(re.search('<', nosharp)):
+                        nosharp = ''
+                        sharp = ''
                     
                     data = re.sub('\[\[(((?!\]\]).)*)\]\]', '<a title="' + re.sub('#', '\#', nosharp) + sharp + '" class="' + clas + '" href="/w/' + url_pas(nosharp) + sharp + '">' + re.sub('(?:<a ([^>]*)>|<\/a>)', '', g) + '</a>', data, 1)