forked from rDrama/rDrama
fix nonces in py files
parent
f23cbadca4
commit
daad32d0ce
|
@ -280,9 +280,9 @@ class Comment(Base):
|
||||||
if v:
|
if v:
|
||||||
sub = self.post.sub
|
sub = self.post.sub
|
||||||
if sub in {'furry','vampire','racist','femboy'} and not v.house.lower().startswith(sub): body += ' disabled '
|
if sub in {'furry','vampire','racist','femboy'} and not v.house.lower().startswith(sub): body += ' disabled '
|
||||||
body += f''' data-nonce="{{g.nonce}}" data-onclick="poll_vote_{o.exclusive}('{o.id}', '{self.id}', 'comment')"'''
|
body += f''' data-nonce="{g.nonce}" data-onclick="poll_vote_{o.exclusive}('{o.id}', '{self.id}', 'comment')"'''
|
||||||
else:
|
else:
|
||||||
body += f''' data-nonce="{{g.nonce}}" data-onclick="poll_vote_no_v()"'''
|
body += f''' data-nonce="{g.nonce}" data-onclick="poll_vote_no_v()"'''
|
||||||
|
|
||||||
body += f'''><label class="custom-control-label" for="comment-{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
body += f'''><label class="custom-control-label" for="comment-{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||||
if not self.total_poll_voted(v): body += ' d-none'
|
if not self.total_poll_voted(v): body += ' d-none'
|
||||||
|
|
|
@ -285,7 +285,7 @@ class Submission(Base):
|
||||||
|
|
||||||
for o in self.options:
|
for o in self.options:
|
||||||
if o.exclusive > 1:
|
if o.exclusive > 1:
|
||||||
body += f'''<div class="custom-control mt-2"><input name="option-{self.id}" autocomplete="off" class="custom-control-input bet" type="radio" id="{o.id}" data-nonce="{{g.nonce}}" data-onclick="bet_vote(this,'{o.id}')"'''
|
body += f'''<div class="custom-control mt-2"><input name="option-{self.id}" autocomplete="off" class="custom-control-input bet" type="radio" id="{o.id}" data-nonce="{g.nonce}" data-onclick="bet_vote(this,'{o.id}')"'''
|
||||||
if o.voted(v): body += " checked "
|
if o.voted(v): body += " checked "
|
||||||
if not (v and v.coins >= POLL_BET_COINS) or self.total_bet_voted(v): body += " disabled "
|
if not (v and v.coins >= POLL_BET_COINS) or self.total_bet_voted(v): body += " disabled "
|
||||||
|
|
||||||
|
@ -299,7 +299,7 @@ class Submission(Base):
|
||||||
body += " - <b>WINNER!</b>"
|
body += " - <b>WINNER!</b>"
|
||||||
|
|
||||||
if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']:
|
if not winner and v and v.admin_level >= PERMS['POST_BETS_DISTRIBUTE']:
|
||||||
body += f'''<button class="btn btn-primary distribute" data-areyousure="postToastReload(this,'/distribute/{o.id}')" data-nonce="{{g.nonce}}" data-onclick="areyousure(this)">Declare winner</button>'''
|
body += f'''<button class="btn btn-primary distribute" data-areyousure="postToastReload(this,'/distribute/{o.id}')" data-nonce="{g.nonce}" data-onclick="areyousure(this)">Declare winner</button>'''
|
||||||
body += "</div>"
|
body += "</div>"
|
||||||
else:
|
else:
|
||||||
input_type = 'radio' if o.exclusive else 'checkbox'
|
input_type = 'radio' if o.exclusive else 'checkbox'
|
||||||
|
@ -309,9 +309,9 @@ class Submission(Base):
|
||||||
if v:
|
if v:
|
||||||
sub = self.sub
|
sub = self.sub
|
||||||
if sub in {'furry','vampire','racist','femboy'} and not v.house.lower().startswith(sub): body += ' disabled '
|
if sub in {'furry','vampire','racist','femboy'} and not v.house.lower().startswith(sub): body += ' disabled '
|
||||||
body += f''' data-nonce="{{g.nonce}}" data-onclick="poll_vote_{o.exclusive}('{o.id}', '{self.id}', 'post')"'''
|
body += f''' data-nonce="{g.nonce}" data-onclick="poll_vote_{o.exclusive}('{o.id}', '{self.id}', 'post')"'''
|
||||||
else:
|
else:
|
||||||
body += f''' data-nonce="{{g.nonce}}" data-onclick="poll_vote_no_v()"'''
|
body += f''' data-nonce="{g.nonce}" data-onclick="poll_vote_no_v()"'''
|
||||||
|
|
||||||
body += f'''><label class="custom-control-label" for="post-{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
body += f'''><label class="custom-control-label" for="post-{o.id}">{o.body_html}<span class="presult-{self.id}'''
|
||||||
if not self.total_poll_voted(v): body += ' d-none'
|
if not self.total_poll_voted(v): body += ' d-none'
|
||||||
|
|
|
@ -411,7 +411,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
||||||
sanitized = sanitized.replace('\n','')
|
sanitized = sanitized.replace('\n','')
|
||||||
|
|
||||||
if showmore and len(sanitized) > 3500:
|
if showmore and len(sanitized) > 3500:
|
||||||
sanitized = showmore_regex.sub(r'\1<p><button class="showmore" data-nonce="{{g.nonce}}">SHOW MORE</button></p><d class="d-none">\2</d>', sanitized, count=1)
|
sanitized = showmore_regex.sub(r'\1<p><button class="showmore">SHOW MORE</button></p><d class="d-none">\2</d>', sanitized, count=1)
|
||||||
|
|
||||||
return sanitized.strip()
|
return sanitized.strip()
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue