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>
118 lines
4.8 KiB
Text
118 lines
4.8 KiB
Text
[% INCLUDE 'doc-head-open.inc' %]
|
|
<title>Koha › Add to list</title>
|
|
[% INCLUDE 'doc-head-close.inc' %]
|
|
</head>
|
|
|
|
<body id="lists_addbybiblionumber" class="lists">
|
|
<div class="container-fluid">
|
|
|
|
[% UNLESS (authorized) %]
|
|
<p align="center">
|
|
[% IF (errcode==1) %]Could not create a new list. Please check the name.<br/>[% END %]
|
|
[% IF (errcode==2) %]Sorry, you do not have permission to add items to this list.<br/>[% END %]
|
|
<a href="javascript:self.close();">Close this window.</a>
|
|
</p>
|
|
[% ELSE %]
|
|
|
|
[% IF ( multiple ) %]
|
|
<h1>Add [% total | html %] items to [% IF ( singleshelf ) %]<em>[% shelfname | html %]</em>: [% ELSE %]a list:[% END %]</h1>
|
|
[% ELSE %]
|
|
<h1>Add to [% IF ( singleshelf ) %]<em>[% shelfname | html %]</em>[% ELSE %]a list:[% END %]</h1>
|
|
[% END %]
|
|
<ul>
|
|
[% FOREACH biblio IN biblios %]
|
|
<li> <span class="title">[% biblio.title | html %]</span>
|
|
[% IF ( biblio.author ) %]<span class="author"> [% biblio.author | html %] </span>[% END %]
|
|
</li>
|
|
[% END %]
|
|
</ul>
|
|
|
|
<form name="f1" action="/cgi-bin/koha/virtualshelves/addbybiblionumber.pl" method="post">
|
|
[% FOREACH biblio IN biblios %] <input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
|
|
<input type="hidden" name="confirmed" value="1" />
|
|
[% IF ( shelfnumber ) %]<input type="hidden" name="shelfnumber" value="[% shelfnumber | html %]" />[% END %]
|
|
|
|
[% UNLESS ( shelfnumber ) %]
|
|
|
|
[% UNLESS ( newshelf ) %]
|
|
[% IF ( private_shelves.count ) %]
|
|
<fieldset class="rows">
|
|
<legend>Select an existing list</legend>
|
|
<ol>
|
|
<li>
|
|
<label>Choose list</label>
|
|
<select name="shelfnumber" id="shelfnumber">
|
|
[% IF private_shelves.count %]
|
|
<optgroup label="Private lists">
|
|
[% FOREACH private_shelf IN private_shelves %]
|
|
<option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option>
|
|
[% END %]
|
|
</optgroup>
|
|
[% END %]
|
|
[% IF private_shelves_shared_with_me.count %]
|
|
<optgroup label="Private lists shared with me">
|
|
[% FOREACH private_shelf IN private_shelves_shared_with_me %]
|
|
<option value="[% private_shelf.shelfnumber | html %]">[% private_shelf.shelfname | html %]</option>
|
|
[% END %]
|
|
</optgroup>
|
|
[% END %]
|
|
[% IF public_shelves.count %]
|
|
<optgroup label="Public lists">
|
|
[% FOREACH public_shelf IN public_shelves %]
|
|
<option value="[% public_shelf.shelfnumber | html %]">[% public_shelf.shelfname | html %]</option>
|
|
[% END %]
|
|
</optgroup>
|
|
[% END %]
|
|
</select>
|
|
</li>
|
|
</ol>
|
|
[% FOREACH biblio IN biblios %]<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
|
|
[% UNLESS ( biblionumbers ) %]
|
|
<input type="hidden" name="biblionumber" value="[% biblionumber | html %]" />
|
|
[% ELSE %]
|
|
<input type="hidden" name="biblionumbers" value="[% biblionumbers | html %]" />
|
|
[% END %]
|
|
</fieldset>
|
|
|
|
<p>... or...</p>
|
|
[% END %]
|
|
[% END %]
|
|
|
|
<fieldset class="rows"><legend>Add to a new list:</legend>
|
|
<ol><li>
|
|
<label for="newvirtualshelf">
|
|
List name:
|
|
</label>
|
|
[% FOREACH biblio IN biblios %]<input type="hidden" name="biblionumber" value="[% biblio.biblionumber | html %]" />[% END %]
|
|
[% UNLESS ( biblionumbers ) %]
|
|
<input type="hidden" name="biblionumber" id="biblionumber" value="[% biblionumber | html %]" />
|
|
[% ELSE %]
|
|
<input type="hidden" name="biblionumbers" id="biblionumbers" value="[% biblionumbers | html %]" />
|
|
[% END %]
|
|
<input type="text" name="newvirtualshelf" id="newvirtualshelf" size="40" />
|
|
<input type="hidden" name="confirmed" value="1" />
|
|
</li>
|
|
<li>
|
|
<label for="category">Category:</label>
|
|
<select name="category" id="category">
|
|
<option value="1">Private</option>
|
|
<option value="2">Public</option>
|
|
</select>
|
|
</li></ol>
|
|
</fieldset>
|
|
|
|
|
|
[% END %]
|
|
|
|
|
|
<!-- SAVE -->
|
|
<fieldset class="action">
|
|
<input type="hidden" name="sortfield" value="title" />
|
|
<input type="submit" value="Save" class="submit" /> <a class="close cancel" href="#">Cancel</a>
|
|
</fieldset>
|
|
</form>
|
|
<!-- /SAVE -->
|
|
|
|
[% SET popup_window = 1 %]
|
|
[% INCLUDE 'intranet-bottom.inc' %]
|
|
[% END %]
|