yoinked commited on
Commit
d6e3fde
β€’
1 Parent(s): be6e01f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +6 -0
app.py CHANGED
@@ -135,6 +135,12 @@ def publish_paper(title, authors, tags, abst, data):
135
  idx += 1
136
  if idx > 100:
137
  return "could not generate paperid, try again tomorrow"
 
 
 
 
 
 
138
  metadata = f"""---
139
  title: {title}
140
  author: {authors}
 
135
  idx += 1
136
  if idx > 100:
137
  return "could not generate paperid, try again tomorrow"
138
+ bad_chars = "<>:|\\" # primitive anti-xss sanitization
139
+ for c in bad_chars:
140
+ title = title.replace(c, "")
141
+ authors = authors.replace(c, "")
142
+ tags = tags.replace(c, "")
143
+ abst = abst.replace(c, "")
144
  metadata = f"""---
145
  title: {title}
146
  author: {authors}