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>
164 lines
5.1 KiB
Text
164 lines
5.1 KiB
Text
[% USE raw %]
|
|
<SUBJECT>
|
|
Your list: [% shelfname | $raw %]
|
|
<END_SUBJECT>
|
|
|
|
[% USE HtmlToText %]
|
|
|
|
<HEADER>
|
|
[% FILTER html2text %]
|
|
<p>Hi,</p>
|
|
|
|
<p>Here is your list called [% shelfname | $raw %], sent from our online catalog.</p>
|
|
|
|
<p>Please note that the attached file is a MARC bibliographic records file
|
|
which can be imported into personal bibliographic software like EndNote,
|
|
Reference Manager or ProCite.</p>
|
|
<hr/>
|
|
[% END %]
|
|
|
|
<END_HEADER>
|
|
|
|
<MESSAGE>
|
|
[% FILTER html2text %]
|
|
|
|
[% IF comment %]
|
|
<p>[% comment | $raw %]</p>
|
|
<hr/>
|
|
[% END %]
|
|
<ol>
|
|
[% FOREACH BIBLIO_RESULT IN BIBLIO_RESULTS %]
|
|
<li>
|
|
<span>
|
|
[% BIBLIO_RESULT.title | $raw %]
|
|
[% IF ( BIBLIO_RESULT.subtitle.size ) %]
|
|
[% FOREACH subtitle IN BIBLIO_RESULT.subtitle %]
|
|
[% subtitle.subfield | $raw %]
|
|
[% END %]
|
|
[% END %]
|
|
</span>
|
|
|
|
<p>
|
|
[% IF ( BIBLIO_RESULT.HASAUTHORS ) %]
|
|
<span>Author(s): [% IF ( BIBLIO_RESULT.author ) %][% BIBLIO_RESULT.author | $raw %][% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.MARCAUTHORS ) %]
|
|
[% IF ( BIBLIO_RESULT.author ) %]; [% END %]
|
|
[% FOREACH MARCAUTHOR IN BIBLIO_RESULT.MARCAUTHORS %]
|
|
[% FOREACH MARCAUTHOR_SUBFIELDS_LOO IN MARCAUTHOR.MARCAUTHOR_SUBFIELDS_LOOP %]
|
|
[% MARCAUTHOR_SUBFIELDS_LOO.separator | $raw %][% MARCAUTHOR_SUBFIELDS_LOO.value | $raw %]
|
|
[% END %]
|
|
[% UNLESS ( loop.last ) %];[% END %]
|
|
[% END %]
|
|
[% END %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.ISBN ) %]
|
|
<span>
|
|
ISBN: [% FOREACH isbn IN BIBLIO_RESULT.ISBN %]
|
|
[% isbn | $raw %]
|
|
[% UNLESS ( loop.last ) %]; [% END %]
|
|
[% END %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF BIBLIO_RESULT.publishercode %]
|
|
<span>
|
|
Published by: [% BIBLIO_RESULT.publishercode | $raw %]
|
|
[% IF ( BIBLIO_RESULT.publicationyear ) %]
|
|
in [% BIBLIO_RESULT.publicationyear | $raw %]
|
|
[% END %]
|
|
[% IF ( BIBLIO_RESULT.pages ) %]
|
|
, [% BIBLIO_RESULT.pages | $raw %]
|
|
[% END %]
|
|
[% IF BIBLIO_RESULT.item('size') %]
|
|
, [% BIBLIO_RESULT.item('size') | html %]
|
|
[% END %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF BIBLIO_RESULT.collection %]
|
|
<span>
|
|
Collection: [% BIBLIO_RESULT.seriestitle | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.subject ) %]
|
|
<span>
|
|
Subject: [% BIBLIO_RESULT.subject | $raw %]
|
|
<span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.copyrightdate ) %]
|
|
<span>
|
|
Copyright year: [% BIBLIO_RESULT.copyrightdate | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.notes ) %]
|
|
<span>
|
|
Notes : [% BIBLIO_RESULT.notes | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.unititle ) %]
|
|
<span>
|
|
Unified title: [% BIBLIO_RESULT.unititle | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.serial ) %]
|
|
<span>
|
|
Serial: [% BIBLIO_RESULT.serial | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.dewey ) %]
|
|
<span>
|
|
Dewey: [% BIBLIO_RESULT.dewey | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.classification ) %]
|
|
<span>
|
|
Classification: [% BIBLIO_RESULT.classification | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
|
|
[% IF ( BIBLIO_RESULT.lccn ) %]
|
|
<span>
|
|
LCCN: [% BIBLIO_RESULT.lccn | $raw %]
|
|
</span><br/>
|
|
[% END %]
|
|
[% IF ( BIBLIO_RESULT.url ) %]
|
|
<span>
|
|
URL: [% BIBLIO_RESULT.url | html %]
|
|
</span>
|
|
[% END %]
|
|
</p>
|
|
|
|
[% IF ( OPACBaseURL ) %]
|
|
<p>
|
|
In online catalog: [% OPACBaseURL | $raw %]/cgi-bin/koha/opac-detail.pl?biblionumber=[% BIBLIO_RESULT.biblionumber | html %]
|
|
</p>
|
|
[% END %]
|
|
[% IF ( BIBLIO_RESULT.ITEM_RESULTS.size ) %]
|
|
<p>Items:
|
|
<ul>
|
|
[% FOREACH ITEM_RESULT IN BIBLIO_RESULT.ITEM_RESULTS %]<li>
|
|
[% ITEM_RESULT.branchname | $raw %]
|
|
[% ITEM_RESULT.location | $raw %]
|
|
[% IF ITEM_RESULT.itemcallnumber %]([% ITEM_RESULT.itemcallnumber | $raw %])[% END %]
|
|
[% ITEM_RESULT.barcode | $raw %]
|
|
</li>[% END %]
|
|
</ul>
|
|
</p>
|
|
[% END %]
|
|
<hr/>
|
|
</li>
|
|
[% END %]
|
|
</ol>
|
|
|
|
[% END %]
|
|
<END_MESSAGE>
|