Fixed forum post deletion and editing.

This commit is contained in:
flash 2023-08-04 22:49:09 +00:00
parent cf71129153
commit 87915b6a25
3 changed files with 4 additions and 4 deletions

View file

@ -120,7 +120,7 @@ if($mode === 'edit') {
return; return;
} }
if(!perms_check($perms, $post['poster_id'] === $currentUserId ? MSZ_FORUM_PERM_EDIT_POST : MSZ_FORUM_PERM_EDIT_ANY_POST)) { if(!perms_check($perms, (string)$post['poster_id'] === $currentUserId ? MSZ_FORUM_PERM_EDIT_POST : MSZ_FORUM_PERM_EDIT_ANY_POST)) {
echo render_error(403); echo render_error(403);
return; return;
} }

View file

@ -4,10 +4,10 @@
{% endapply %} {% endapply %}
{% endmacro %} {% endmacro %}
{% macro input_csrf() %} {% macro input_csrf(name) %}
{% from _self import input_hidden %} {% from _self import input_hidden %}
{% apply spaceless %} {% apply spaceless %}
{{ input_hidden('_csrf', csrf_token()) }} {{ input_hidden(name|default('_csrf'), csrf_token()) }}
{% endapply %} {% endapply %}
{% endmacro %} {% endmacro %}

View file

@ -7,7 +7,7 @@
{% block content %} {% block content %}
<form action="" method="get" class="container forum__confirm"> <form action="" method="get" class="container forum__confirm">
{{ container_title('<i class="' ~ class|default('fas fa-exclamation-circle') ~ ' fa-fw"></i> ' ~ title) }} {{ container_title('<i class="' ~ class|default('fas fa-exclamation-circle') ~ ' fa-fw"></i> ' ~ title) }}
{{ input_csrf() }} {{ input_csrf('csrf') }}
{% for name, value in params %} {% for name, value in params %}
<input type="hidden" name="{{ name }}" value="{{ value }}"> <input type="hidden" name="{{ name }}" value="{{ value }}">
{% endfor %} {% endfor %}