forked from rDrama/rDrama
1
0
Fork 0

fdMerge branch 'frost' of https://github.com/Aevann1/Drama into frost

master
Aevann1 2022-05-27 18:37:54 +00:00
commit 5221cae7c6
4 changed files with 6 additions and 6 deletions

View File

@ -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()

View File

@ -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('<pre>'):
if '```' not in sanitized and '<pre>' not in sanitized:
sanitized = linefeeds_regex.sub(r'\1\n\n\2', sanitized)
sanitized = image_regex.sub(r'\1![](\2)\4', sanitized)

View File

@ -822,7 +822,7 @@
<div class="h6">We're sorry something here is wrong.</div>
<small class="form-text text-muted">Please enter a reason for reporting below.</small>
<pre></pre>
<input autocomplete="off" maxlength="100" id="reason-comment" class="form-control">
<input autocomplete="off" maxlength="100" id="reason_comment" class="form-control">
</div>
<div class="modal-footer">
<button class="btn btn-link text-muted" data-bs-dismiss="modal">Cancel</button>
@ -846,7 +846,7 @@
{% if v %}
<script src="/assets/js/marked.js?v=256"></script>
<script src="/assets/js/comments_v.js?v=270"></script>
<script src="/assets/js/comments_v.js?v=271"></script>
{% endif %}
<script src="/assets/js/clipboard.js?v=250"></script>

View File

@ -32,4 +32,4 @@
</div>
</div>
<script src="/assets/js/report_post_modal.js?v=241"></script>
<script src="/assets/js/report_post_modal.js?v=242"></script>