Koha/koha-tmpl/intranet-tmpl/prog/en/includes/patroncards-errors.inc
Jonathan Druart dcd1f5d48c Bug 13618: Add html filters to all the variables
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>
2018-08-17 15:55:05 +00:00

57 lines
4.2 KiB
HTML

[% BLOCK asksysadmin %]<span>Please have your system administrator check the error log for details.</span>[% END %]
[% BLOCK b_batch %]<span>Batch: </span>[% END %]
[% BLOCK b_patronlist %]<span>Patron list: </span>[% END %]
[% BLOCK b_patronnumber %]<span>Patron number: </span>[% END %]
[% BLOCK b_layout %]<span>Layout: </span>[% END %]
[% BLOCK b_template %]<span>Template: </span>[% END %]
[% IF ( error || CGI.param('pdferr') ) %]
<div class="dialog alert">
<p>
<strong>WARNING:</strong>
[% IF CGI.param('pdferr') %]<span>Error while creating PDF file. </span>
[% IF CGI.param('errnocards') %]<span>No cards created (empty batch or list?) </span>[% END %]
[% IF CGI.param('errba') %][% INCLUDE b_batch %]<span class="ex">[%- CGI.param('errba') | html -%]</span>[% END %]
[% IF CGI.param('errpl') %][% INCLUDE b_patronlist %]<span class="ex">[%- CGI.param('errpl') | html -%]</span>][% END %]
[% IF CGI.param('errpt') %][% INCLUDE b_patronnumber %]<span class="ex">[%- CGI.param('errpt') | html -%]</span>[% END %]
[% IF CGI.param('errlo') %][% INCLUDE b_layout %]<span class="ex">[%- CGI.param('errlo') | html -%]</span>[% END %]
[% IF CGI.param('errtpl') %][% INCLUDE b_template %]<span class="ex">[%- CGI.param('errtpl') | html -%]</span>[% END %]
[% INCLUDE asksysadmin %]
[% END %]
[% IF ( error == 101 ) %]
[% IF ( card_element ) %]<span>The database returned an error while saving [% card_element | html %] [% element_id | html %]. </span>
[% ELSE %]<span>The database returned an error while attempting a save operation. </span>[% END %][% INCLUDE asksysadmin %]
[% ELSIF ( error == 102 ) %]
[% IF ( card_element ) %]<span>The database returned an error while deleting [% card_element | html %] [% element_id | html %]. </span>
[% ELSIF ( image_ids ) %]<span>The database returned an error while deleting [% image_ids | html %]. </span>
[% ELSE %]<span>The database returned an error while attempting a delete operation. </span>[% END %][% INCLUDE asksysadmin %]
[% ELSIF ( error == 201 ) %]
[%IF ( element_id ) %]<span>An unsupported operation was attempted on [% card_element | html %] [% element_id | html %]. </span>
[% ELSE %]<span>An unsupported operation was attempted. </span>[% END %][% INCLUDE asksysadmin %]
[% ELSIF ( error == 202 ) %]
<span>An error has occurred. </span>[% INCLUDE asksysadmin %]
[% ELSIF ( error == 203 ) %]
<span>A non-existent or invalid library code was supplied. Please verify that you have a library set. </span><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a>
[% ELSIF ( error == 301 ) %]
<span>An error has occurred while attempting to upload the image file. </span>[% INCLUDE asksysadmin %]
[% ELSIF ( error == 302 ) %]
<span>Image exceeds 500KB. Please resize and import again. </span>
[% ELSIF ( error == 303 ) %]
<span>The database image quota currently only allows a maximum of [% image_limit | html %] images to be stored at any one time. Please delete one or more images to free up quota space. </span>
[% ELSIF ( error == 304 ) %]
<span>An image with the name '[% IMAGE_NAME | html %]' already exists.</span>
[% ELSIF ( error == 401 ) %]
<span>An error has occurred and no items have been added to batch [% batch_id | html %]. </span>[% INCLUDE asksysadmin %]
[% ELSIF ( error == 402 ) %]
<span>No items added because the library is not set. Please set your library before adding items to a batch. </span><a href="/cgi-bin/koha/circ/selectbranchprinter.pl">Set library</a>
[% ELSIF ( error == 403 ) %]
<span>An error has occurred and the item(s) was not removed from batch [% batch_id | html %]. </span>[% INCLUDE asksysadmin %]
[% ELSIF ( error == 404 ) %]
<span>An error has occurred and batch [% batch_id | html %] was not deleted. </span>[% INCLUDE asksysadmin %]
[% ELSIF ( error == 405 ) %]
<span>An error has occurred and batch [% batch_id | html %] was not fully de-duplicated. </span>
[% END %]
</p>
</div>
[% END %]