Bug 39317: Fix CSRF protection for letters

TEST PLAN:
1 - go to /cgi-bin/koha/tools/letter.pl
2 - click on New notice -> claim serial issue (or any other one)
3 - Fill required fields with random string
4 - Save -> if it breaks, go to
5 - Open a network panel (F12 -> network)
6 - Filter on letter.pl
7 - Fill another new notice -> the arguments of the form page have been
  passed in the address of the POST request.
8 - Apply patch
9 - Repeat the whole process and see it works now

Signed-off-by: Magnus Enger <magnus@libriotech.no>
I can't recreate the problem, but the change seems sensible enough
and does not seem to introduce a regression, I can still save a
new letter/notice.
Signed-off-by: David Cook <dcook@prosentient.com.au>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Baptiste Wojtkowski 2025-03-12 14:42:42 +01:00 committed by Katrin Fischer
parent 4a6d097c31
commit 248013a2a9
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 1 additions and 1 deletions

View File

@ -366,7 +366,7 @@
</div>
<!-- /#toolbar -->
<form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" class="validate">
<form id="add_notice" name="Aform" method="post" enctype="multipart/form-data" action="/cgi-bin/koha/tools/letter.pl" class="validate">
[% INCLUDE 'csrf-token.inc' %]
[% IF add_form %]
<input type="hidden" name="op" id="op" value="cud-add_validate" />