dcd1f5d48c
Here we go, next step then. As we did not fix the performance issue when autofiltering the variables (see bug 20975), the only solution we have is to add the filters explicitely. This patch has been autogenerated (using add_html_filters.pl, see next pathces) and add the html filter to all the variables displayed in the template. Exceptions are made (using the new 'raw' TT filter) to the variable we already listed in the previous versions of this patch. To test: - Use t/db_dependent/Koha/Patrons.t to populate your DB with autogenerated data which contain <script> tags - Remove them from borrower_debarments.comments (there are allowed here) update borrower_debarments set comment="html tags possible here"; - From the interface hit page and try to catch alert box. If you find one it means you find a possible XSS. To know where it comes from: * note the exact URL where you found it * note the alert box content * Dump your DB and search for the string in the dump to identify its location (for instance table.field) Next: * Ideally we would like to use the raw filter when it is not necessary to HTML escape the variables (in big loop for instance) * Provide a QA script to catch missing filters (we want html, uri, url or raw, certainly others that I am forgetting now) * Replace the html filters with uri when needed (!) Signed-off-by: Owen Leonard <oleonard@myacpl.org> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com> Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
65 lines
4.5 KiB
HTML
65 lines
4.5 KiB
HTML
[% INCLUDE 'blocking_errors.inc' %]
|
|
[% IF subscriptionid and ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription || CAN_user_serials_receive_serials ) %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
[% IF CAN_user_serials_create_subscription %]
|
|
[% IF biblionumber_for_new_subscription %]
|
|
<div class="btn-group"><a id="newsubscription" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription | html %]"><i class="fa fa-plus"></i> New subscription</a></div>
|
|
[% ELSE %]
|
|
<div class="btn-group"><a id="newsubscription" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/subscription-add.pl"><i class="fa fa-plus"></i> New subscription</a></div>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF ( CAN_user_serials_edit_subscription || CAN_user_serials_create_subscription || CAN_user_serials_delete_subscription ) %]
|
|
[% UNLESS ( cannotedit ) %]
|
|
<div class="btn-group">
|
|
<button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-pencil"></i> Edit <span class="caret"></span></button>
|
|
<ul class="dropdown-menu">
|
|
[% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
|
|
<li> [% END %]
|
|
<a href="/cgi-bin/koha/serials/subscription-add.pl?op=modify&subscriptionid=[% subscriptionid | html %]">Edit subscription</a></li>
|
|
[% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
|
|
<li> [% END %]
|
|
<a href="/cgi-bin/koha/serials/subscription-add.pl?op=dup&subscriptionid=[% subscriptionid | html %]">Edit as new (duplicate)</a></li>
|
|
|
|
[% IF CAN_user_editcatalogue_edit_catalogue %]
|
|
<li><a id="editbiblio" href="/cgi-bin/koha/cataloguing/addbiblio.pl?biblionumber=[% biblionumber | html %]">Edit record</a></li>
|
|
[% END %]
|
|
|
|
[% IF serialsadditems && CAN_user_editcatalogue_edit_items %]
|
|
<li><a id="edititems" href="/cgi-bin/koha/cataloguing/additem.pl?biblionumber=[% biblionumber | html %]">Edit items</a></li>
|
|
[% END %]
|
|
|
|
[% IF ( CAN_user_serials_delete_subscription ) %]
|
|
[% IF ( cannotedit ) %] <li class="disabled"> [% ELSE %]
|
|
<li> [% END %]
|
|
<a href="#" id="deletesub">Delete subscription</a></li>[% END %]
|
|
</ul>
|
|
</div>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
[% IF not cannotedit or CAN_user_serials_receive_serials %]
|
|
[% IF CAN_user_serials_renew_subscription and not closed %]
|
|
<div class="btn-group"><a id="renew" class="btn btn-default btn-sm" href="#"><i class="fa fa-refresh"></i> Renew</a></div>
|
|
[% END %]
|
|
[% IF CAN_user_serials_receive_serials and not closed %]
|
|
<div class="btn-group"><a id="receive" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/serials-edit.pl?subscriptionid=[% subscriptionid | html %]&serstatus=1,3"><i class="fa fa-inbox"></i> Receive</a></div>
|
|
[% END %]
|
|
[% UNLESS cannotedit %]
|
|
[% IF closed %]
|
|
<div class="btn-group"><a id="reopen" class="btn btn-default btn-sm" href="#"><i class="fa fa-repeat"></i> Reopen</a></div>
|
|
[% ELSE %]
|
|
<div class="btn-group"><a id="close" class="btn btn-default btn-sm" href="#"><i class="fa fa-times-circle"></i> Close</a></div>
|
|
[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
</div>
|
|
[% ELSIF CAN_user_serials_create_subscription %]
|
|
<div id="toolbar" class="btn-toolbar">
|
|
[% IF ( biblionumber_for_new_subscription ) %]
|
|
<div class="btn-group"><a id="newsubscription" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/subscription-add.pl?biblionumber_for_new_subscription=[% biblionumber_for_new_subscription | html %]"><i class="fa fa-plus"></i> New subscription</a></div>
|
|
[% ELSE %]
|
|
<div class="btn-group"><a id="newsubscription" class="btn btn-default btn-sm" href="/cgi-bin/koha/serials/subscription-add.pl"><i class="fa fa-plus"></i> New subscription</a></div>
|
|
[% END %]
|
|
</div>
|
|
[% END %]
|