Bugzilla – Attachment 173087 Details for
Bug 38030
stocknumberAV.pl fails with CSRF protection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38030: (QA follow-up) Move csrf_token to POST body from URL
Bug-38030-QA-follow-up-Move-csrftoken-to-POST-body.patch (text/plain), 1.55 KB, created by
David Cook
on 2024-10-22 00:43:18 UTC
(
hide
)
Description:
Bug 38030: (QA follow-up) Move csrf_token to POST body from URL
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-10-22 00:43:18 UTC
Size:
1.55 KB
patch
obsolete
>From 9bc64f22afdaa8a11c79e00f14fe823cff4a624e Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 22 Oct 2024 00:42:22 +0000 >Subject: [PATCH] Bug 38030: (QA follow-up) Move csrf_token to POST body from > URL > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > cataloguing/value_builder/stocknumberAV.pl | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/cataloguing/value_builder/stocknumberAV.pl b/cataloguing/value_builder/stocknumberAV.pl >index 92e6e59dc0..dedef7968a 100755 >--- a/cataloguing/value_builder/stocknumberAV.pl >+++ b/cataloguing/value_builder/stocknumberAV.pl >@@ -50,13 +50,14 @@ my $builder = sub { > function Click$params->{id}(ev) { > ev.preventDefault(); > var code = document.getElementById(ev.data.id); >- const token = document.getElementsByName('csrf_token')[0].value; >+ const csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); > \$.ajax({ >- url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl?csrf_token=' + token, >+ url: '/cgi-bin/koha/cataloguing/plugin_launcher.pl', > type: 'POST', > data: { > 'plugin_name': 'stocknumberAV.pl', > 'code' : code.value, >+ 'csrf_token': csrf_token > }, > success: function(data){ > var field = document.getElementById(ev.data.id); >-- >2.39.2
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 38030
:
172216
|
172238
|
173086
| 173087