Bugzilla – Attachment 173085 Details for
Bug 38065
Auto control number (001) widget in advanced editor does not work under CSRF protection
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 38065: (QA follow-up) Move csrf_token to POST body from URL
Bug-38065-QA-follow-up-Move-csrftoken-to-POST-body.patch (text/plain), 1.74 KB, created by
David Cook
on 2024-10-22 00:33:21 UTC
(
hide
)
Description:
Bug 38065: (QA follow-up) Move csrf_token to POST body from URL
Filename:
MIME Type:
Creator:
David Cook
Created:
2024-10-22 00:33:21 UTC
Size:
1.74 KB
patch
obsolete
>From 0e9077c0ae3b5ec23e0f91581570093482ebf495 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Tue, 22 Oct 2024 00:31:23 +0000 >Subject: [PATCH] Bug 38065: (QA follow-up) Move csrf_token to POST body from > URL > >Signed-off-by: David Cook <dcook@prosentient.com.au> >--- > .../prog/en/includes/cateditor-widgets-marc21.inc | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >index 67a9c120f2..1a87de386f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/cateditor-widgets-marc21.inc >@@ -152,9 +152,10 @@ require( [ 'koha-backend', 'widget', 'text-marc' ], function( KohaBackend, Widge > $( this.node ) > .find('.control-number-widget-assign').click( function() { > var sequence = $( widget.node ).find('.control-number-widget-sequence').val(); >- const token = $("input[name='csrf_token']").first().val(); >+ const csrf_token = document.querySelector('meta[name="csrf-token"]').getAttribute('content'); > $.post( >- '/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence + '?csrf_token=' + token >+ '/cgi-bin/koha/svc/cataloguing/control_num_sequences/' + sequence, >+ { csrf_token: csrf_token } > ).done( function( result ) { > if ( result.next_value ) widget.setControlNumber( result.next_value ); > } ); >-- >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 38065
:
172326
|
172333
|
173084
| 173085