From daad32d0ce8ce4719aa921661e5440bcbc85b392 Mon Sep 17 00:00:00 2001
From: Aevann
Date: Mon, 2 Jan 2023 06:20:59 +0200
Subject: [PATCH] fix nonces in py files
---
files/classes/comment.py | 4 ++--
files/classes/submission.py | 8 ++++----
files/helpers/sanitize.py | 2 +-
3 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/files/classes/comment.py b/files/classes/comment.py
index 153a60e2b6..2e49a20c93 100644
--- a/files/classes/comment.py
+++ b/files/classes/comment.py
@@ -280,9 +280,9 @@ class Comment(Base):
if v:
sub = self.post.sub
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:
- 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'''>
\2', sanitized, count=1)
+ sanitized = showmore_regex.sub(r'\1\2', sanitized, count=1)
return sanitized.strip()