Koha/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.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

90 lines
4.2 KiB
Text

[% USE Koha %]
[% USE KohaDates %]
[% SET footerjs = 1 %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Check duplicate patron</title>
[% INCLUDE 'doc-head-close.inc' %]
</head>
<body id="pat_moremember-brief" class="pat">
<div class="container-fluid">
<div class="row">
<div class="col-xs-12">
<h3>[% UNLESS ( I ) %]
[% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])</h3>
</div>
</div>
<div class="row">
<div class="col-xs-6">
<div id="patron-information">
[% UNLESS ( I ) %][% IF ( othernames ) %]&ldquo;[% othernames | html %]&rdquo;[% END %]
<div class = "address">
<ul>
[% IF Koha.Preference( 'AddressFormat' ) %]
[% INCLUDE "member-display-address-style-${ Koha.Preference( 'AddressFormat' ) }.inc" %]
[% ELSE %]
[% INCLUDE 'member-display-address-style-us.inc' %]
[% END %]
</ul>
</div>
<div class="rows">
<ol>
[% IF ( phone ) %]<li><span class="label">Primary phone: </span>[% phone | html %]</li>[% END %]
[% IF ( phonepro ) %]<li><span class="label">Secondary phone: </span>[% phonepro | html %]</li>[% END %]
[% IF ( mobile ) %]<li><span class="label">Other phone: </span>[% mobile | html %]</li>[% END %]
[% IF ( fax ) %]<li><span class="label">Fax: </span>[% fax | html %]</li>[% END %]
[% IF ( email ) %]<li class="email"><span class="label">Primary email:</span><a href="mailto:[% email | html %]">[% email | html %]</a></li>[% END %]
[% IF ( emailpro ) %]<li class="email"><span class="label">Secondary email: </span><a href="mailto:[% emailpro | html %]">[% emailpro | html %]</a></li>[% END %]
[% UNLESS ( I ) %]
[% IF ( inititals ) %]<li><span class="label">Initials: </span>[% initials | html %]</li>[% END %]
[% IF ( dateofbirth ) %]<li><span class="label">Date of birth:</span>[% dateofbirth | $KohaDates %]</li>[% END %]
[% IF ( sex ) %]<li><span class="label">Gender:</span>[% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex | html %][% END %]</li>[% END %][% END %]
[% END %]
[% IF ( isguarantee ) %]
[% IF ( guaranteeloop ) %]
<li><span class="label">Guarantees:</span><ul>[% FOREACH guaranteeloo IN guaranteeloop %]<li><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guaranteeloo.borrowernumber | html %]">[% guaranteeloo.name | html %] </a></li>[% END %]</ul></li>
[% END %]
[% ELSE %]
[% IF ( guarantor.borrowernumber ) %]
<li><span class="label">Guarantor:</span><a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% guarantor.borrowernumber | html %]">[% guarantor.surname | html %], [% guarantor.firstname | html %]</a></li>
[% END %]
[% END %]
</ol>
</div>
</div>
</div>
<div class="col-xs-6">
<div id="patron-library-details">
<h3>Library use</h3>
<div class="rows">
<ol>
<li><span class="label">Card number: </span>[% cardnumber | html %]</li>
<li><span class="label">Borrowernumber: </span> [% borrowernumber | html %]</li>
<li><span class="label">Category: </span>[% categoryname | html %] ([% categorycode | html %])</li>
<li><span class="label">Registration date: </span>[% dateenrolled | $KohaDates %]</li>
<li><span class="label">Expiration date: </span>
[% IF ( was_renewed ) %]
<strong class="reregistrinfo">[% dateexpiry | $KohaDates %]</strong>
[% ELSE %]
[% dateexpiry | $KohaDates %]
[% END %]
</li>
<li><span class="label">Library: </span>[% branchname | html %]</li>
[% IF ( sort1 ) %]<li><span class="label">Sort field 1:</span>[% lib1 | html %]</li>[% END %]
[% IF ( sort2 ) %]<li><span class="label">Sort field 2:</span>[% lib2 | html %]</li>[% END %]
</ol>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<fieldset class="action"><input type="button" class="close" value="Close window" /></fieldset>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]