master
Aevann1 2022-01-19 11:19:38 +02:00
parent 81078c5877
commit 0536b03a46
3 changed files with 11 additions and 11 deletions

View File

@ -398,7 +398,7 @@ def edit_post(pid, v):
body = request.values.get("body", "").strip().replace('','')
if len(body) > 10000: return {"error":"Character limit is 10000!"}, 403
if len(body) > 20000: return {"error":"Character limit is 20000!"}, 403
if v.marseyawarded:
marregex = list(re.finditer("^(:[!#]{0,2}m\w+:\s*)+$", title))
@ -470,7 +470,7 @@ def edit_post(pid, v):
elif v.bird:
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400
if len(body_html) > 40000: return {"error":"Submission body too long!"}, 400
p.body_html = body_html
@ -850,10 +850,10 @@ def submit_post(v):
g.db.add(ma)
return redirect("/notifications")
if len(str(body)) > 10000:
if len(str(body)) > 20000:
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"10000 character limit for text body."}, 400
return render_template("submit.html", v=v, error="10000 character limit for text body.", title=title, url=url, body=request.values.get("body", "")), 400
if request.headers.get("Authorization") or request.headers.get("xhr"): return {"error":"There's a 20000 character limit for text body."}, 400
return render_template("submit.html", v=v, error="There's a 20000 character limit for text body.", title=title, url=url, body=request.values.get("body", "")), 400
if len(url) > 2048:
@ -902,7 +902,7 @@ def submit_post(v):
elif v.bird:
if len(body) > 140 : return {"error":"You have to type less than 140 characters!"}, 403
if len(body_html) > 20000: return {"error":"Submission body too long!"}, 400
if len(body_html) > 40000: return {"error":"Submission body too long!"}, 400
bans = filter_comment_html(body_html)
if bans:
@ -925,7 +925,7 @@ def submit_post(v):
app_id=v.client.application.id if v.client else None,
is_bot = request.headers.get("Authorization"),
url=url,
body=body[:10000],
body=body[:20000],
body_html=body_html,
embed_url=embed,
title=title[:500],
@ -1073,7 +1073,7 @@ def submit_post(v):
body_html = sanitize(body)
if len(body_html) < 20000:
if len(body_html) < 40000:
c = Comment(author_id=SNAPPY_ID,
distinguish_level=6,
parent_submission=new_post.id,

View File

@ -479,7 +479,7 @@
<input autocomplete="off" type="hidden" name="formkey" value="{{v.formkey}}">
<input autocomplete="off" type="hidden" name="current_page" value="{{request.path}}">
<textarea autocomplete="off" max-length="500" name="title" class="comment-box form-control rounded" required placeholder="title">{{p.title}}</textarea>
<textarea autocomplete="off" name="body" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" oninput="markdown('post-edit-box-{{p.id}}', 'post-edit-{{p.id}}');charLimit('post-edit-box-{{p.id}}','charcount-post-edit')" id="post-edit-box-{{p.id}}" form="post-edit-form-{{p.id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10" data-id="{{p.id}}">{{p.body}}</textarea>
<textarea autocomplete="off" name="body" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" oninput="markdown('post-edit-box-{{p.id}}', 'post-edit-{{p.id}}');charLimit('post-edit-box-{{p.id}}','charcount-post-edit')" id="post-edit-box-{{p.id}}" form="post-edit-form-{{p.id}}" class="comment-box form-control rounded" aria-label="With textarea" placeholder="Add text to your post..." rows="10" data-id="{{p.id}}">{{p.body}}</textarea>
<div class="text-small font-weight-bold mt-1" id="charcount-post-edit" style="right: 1rem; bottom: 0.5rem; z-index: 3;"></div>

View File

@ -106,10 +106,10 @@
</div>
</div>
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Uses markdown. Limited to 10000 characters."></i></label>
<label for="body" class="mt-3">Text<i class="fas fa-info-circle text-gray-400 ml-1" data-bs-toggle="tooltip" data-bs-placement="top" data-bs-original-title="Uses markdown. Limited to 20000 characters."></i></label>
<div>
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}10000{% endif %}" required></textarea>
<textarea form="submitform" id="post-text" class="form-control rounded" aria-label="With textarea" placeholder="Optional if you have a link or an image." rows="7" name="body" oninput="markdown('post-text','preview');charLimit('post-text','character-count-submit-text-form');checkForRequired();savetext()" {% if v.longpost %}minlength="280"{% endif %} maxlength="{% if v.bird %}140{% else %}20000{% endif %}" required></textarea>
<div class="btn btn-secondary fl-r mt-3" onclick="document.getElementById('preview').classList.toggle('d-none');">
Toggle preview