diff --git a/files/helpers/media.py b/files/helpers/media.py index 20de94da35..cd7fb62bfd 100644 --- a/files/helpers/media.py +++ b/files/helpers/media.py @@ -13,7 +13,7 @@ def process_audio(file): name = f'/audio/{time.time()}'.replace('.','') + '.' + file.filename.split('.')[-1].lower() file.save(name) - if SITE_NAME == 'WPD' or os.stat(name).st_size > 8 * 1024 * 1024: + if os.stat(name).st_size > 8 * 1024 * 1024: with open(name, 'rb') as f: os.remove(name) req = requests.request("POST", "https://pomf2.lain.la/upload.php", files={'files[]': f}, timeout=20).json() @@ -35,7 +35,7 @@ def process_video(file): os.remove(old) size = os.stat(new).st_size - if SITE_NAME == 'WPD' or os.stat(new).st_size > 8 * 1024 * 1024: + if os.stat(new).st_size > 8 * 1024 * 1024: with open(new, 'rb') as f: os.remove(new) req = requests.request("POST", "https://pomf2.lain.la/upload.php", files={'files[]': f}, timeout=20).json() diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 956a230da7..1e92dbe6a3 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -164,7 +164,7 @@ def sanitize(sanitized, alert=False, comment=False, edit=False): signal.signal(signal.SIGALRM, handler) signal.alarm(1) - if not sanitized.startswith('```') and not sanitized.startswith('
'):
+	if '```' not in sanitized and '
' not in sanitized:
 		sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
 
 	sanitized = image_regex.sub(r'\1![](\2)\4', sanitized)
diff --git a/files/templates/comments.html b/files/templates/comments.html
index 2f124c5bbc..1ce24af818 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -822,7 +822,7 @@
 							
We're sorry something here is wrong.
Please enter a reason for reporting below.

-							
+							
 						
 						
 
 
-
\ No newline at end of file
+
\ No newline at end of file