]> jfr.im git - irc/quakenet/qwebirc.git/blob - clean.py
Fix XSS issue where external pages could alter DOM.
[irc/quakenet/qwebirc.git] / clean.py
1 #!/usr/bin/env python
2
3 import bin.pages as pages, os, bin.cleanpyc as cleanpyc, glob
4 from bin.cleanpyc import tryunlink
5
6 for x in pages.UIs:
7 for y in glob.glob(os.path.join("static", "js", "%s-*.js" % x)):
8 tryunlink(y)
9 for y in glob.glob(os.path.join("static", "css", "%s-*.css" % x)):
10 tryunlink(y)
11 tryunlink("static", "css", x + ".css")
12 tryunlink("static", "%s.html" % x)
13 tryunlink("static", "%sdebug.html" % x)
14 tryunlink(".checked")
15 tryunlink(".compiled")
16 tryunlink("bin", ".checked")
17 tryunlink("bin", ".compiled")
18
19 if __name__ == "__main__":
20 tryunlink("static", "js", "qwebirc.js")
21 cleanpyc.main()