Koha/koha-tmpl/opac-tmpl/bootstrap/en/modules/opac-serial-issues.tt
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

162 lines
10 KiB
Text

[% USE Koha %]
[% INCLUDE 'doc-head-open.inc' %]
<title>[% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog &rsaquo; Issues for a subscription</title>
[% INCLUDE 'doc-head-close.inc' %]
[% BLOCK cssinclude %][% END %]
</head>
[% INCLUDE 'bodytag.inc' bodyid='opac-serials-issues' %]
[% INCLUDE 'masthead.inc' %]
<div class="main">
<ul class="breadcrumb">
<li><a href="/cgi-bin/koha/opac-main.pl">Home</a> <span class="divider">&rsaquo;</span></li>
<li><a href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% biblionumber | html %]">Details for [% bibliotitle | html %]</a> <span class="divider">&rsaquo;</span></li>
<li><a href="#">Issues for a subscription</a></li>
</ul>
<div class="container-fluid">
<div class="row-fluid">
[% IF ( OpacNav || OpacNavBottom ) %]
<div class="span2">
<div id="navigation">
[% INCLUDE 'navigation.inc' %]
</div>
</div>
<div class="span10">
[% ELSE %]
<div class="span12">
[% END %]
<div id="userserialissues">
<h2>Issues for a subscription</h2>
<div id="views">
<span class="view">
<a id="Normalview" href="opac-detail.pl?biblionumber=[% biblionumber | html %]" class="button">Normal view</a>
</span>
<span class="view"><span id="Briefhistory">Brief history</span></span>
<span class="view"><a id="Fullhistory" href="opac-serial-issues.pl?selectview=full&amp;biblionumber=[% biblionumber | html %]" class="button">Full history</a></span>
</div>
<form method="post" name="f">
[% FOREACH subscription_LOO IN subscription_LOOP %]
<div id="subscriptionline[% subscription_LOO.subscriptionid | html %]" style="border-bottom:1px solid #EEE;">
<h3>Subscription information for [% subscription_LOO.bibliotitle | html %]</h3>
<p>
The current subscription began on [% subscription_LOO.startdate | html %] and is issued
[% IF ( subscription_LOO.periodicity1 ) %]
twice per day
[% END %]
[% IF ( subscription_LOO.periodicity2 ) %]
every day
[% END %]
[% IF ( subscription_LOO.periodicity3 ) %]
three times per week
[% END %]
[% IF ( subscription_LOO.periodicity4 ) %]
every week
[% END %]
[% IF ( subscription_LOO.periodicity5 ) %]
every 2 weeks
[% END %]
[% IF ( subscription_LOO.periodicity6 ) %]
every 3 weeks
[% END %]
[% IF ( subscription_LOO.periodicity7 ) %]
every month
[% END %]
[% IF ( subscription_LOO.periodicity8 ) %]
every 2 months
[% END %]
[% IF ( subscription_LOO.periodicity9 ) %]
every quarter
[% END %]
[% IF ( subscription_LOO.periodicity10 ) %]
twice per year
[% END %]
[% IF ( subscription_LOO.periodicity11 ) %]
every year
[% END %]
[% IF ( subscription_LOO.periodicity12 ) %]
every 2 years
[% END %]
[% IF ( subscription_LOO.periodicity13 ) %]
irregularly
[% END %]
[% IF ( subscription_LOO.arrival1 ) %]
on Monday
[% END %]
[% IF ( subscription_LOO.arrival2 ) %]
on Tuesday
[% END %]
[% IF ( subscription_LOO.arrival3 ) %]
on Wednesday
[% END %]
[% IF ( subscription_LOO.arrival4 ) %]
on Thursday
[% END %]
[% IF ( subscription_LOO.arrival5 ) %]
on Friday
[% END %]
[% IF ( subscription_LOO.arrival6 ) %]
on Saturday
[% END %]
[% IF ( subscription_LOO.arrival7 ) %]
on Sunday
[% END %]
for
[% IF ( subscription_LOO.numberlength ) %][% subscription_LOO.numberlength | html %] issues[% END %]
[% IF ( subscription_LOO.weeklength ) %][% subscription_LOO.weeklength | html %] weeks[% END %]
[% IF ( subscription_LOO.monthlength ) %][% subscription_LOO.monthlength | html %] months[% END %]
</p>
<p>The first subscription was started on [% subscription_LOO.histstartdate | html %]</p>
[% IF ( subscription_LOO.histenddate ) %]
<p>The subscription expired on [% subscription_LOO.histenddate | html %]</p>
[% END %]
<h4>[% subscription_LOO.branchname | html %]</h4>
[% IF ( subscription_LOO.notes ) %]
<p>[% subscription_LOO.notes FILTER html_line_break | html %]</p>
[% END %]
[% IF ( subscription_LOO.recievedlist ) %]
<h5>Available issues</h5>
<p>[% subscription_LOO.recievedlist | html %]</p>
[% END %]
[% IF ( subscription_LOO.missinglist ) %]
<h5>Unavailable issues</h5>
<p>[% subscription_LOO.missinglist | html %]</p>
[% END %]
[% IF ( subscription_LOO.opacnote ) %]
<h5>Issues summary</h5>
<p>
[% subscription_LOO.opacnote FILTER html_line_break | html %]
</p>
[% END %]
[% IF ( subscription_LOO.letter ) %]
[% IF ( loggedinusername ) %]
[% IF ( subscription_LOO.hasalert ) %]
You have subscribed to email notification on new issues <a href="opac-alert-subscribe.pl?op=cancel&amp;subscriptionid=[% subscription_LOO.subscriptionid | html %]&amp;referer=serial&amp;biblionumber=[% subscription_LOO.biblionumber | html %]" class="btn" title="Cancel email notification">
Cancel email notification
</a>
[% ELSE %]
<a href="opac-alert-subscribe.pl?subscriptionid=[% subscription_LOO.subscriptionid | html %]&amp;referer=serial&amp;biblionumber=[% subscription_LOO.biblionumber | html %]" class="btn" title="Subscribe to email notification on new issues">
Subscribe to email notification on new issues
</a>
[% END %]
[% ELSE %]
You must log in if you want to subscribe to email notification on new issues
[% END %]
[% END %]
</div> <!-- / #subscriptionline* -->
[% END # FOREACH subscription_LOO %]
</form>
</div> <!-- / #userserialissues -->
</div> <!-- / .span10/12 -->
</div> <!-- / .row-fluid -->
</div> <!-- / .container-fluid -->
</div> <!-- / .main -->
[% INCLUDE 'opac-bottom.inc' %]
[% BLOCK jsinclude %][% END %]