summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
35d0003)
Ho, a bug!
Some fields in the address where double filtered.
Test plan:
Use the evil strings in the address field and do a search, you will see
double html encoded characters without this patch.
Signed-off-by: Liz Rea <wizzyrea@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
}
[% BLOCK escape_address %]
[%~ SET address = data.streetnumber _ ' ' %]
}
[% BLOCK escape_address %]
[%~ SET address = data.streetnumber _ ' ' %]
-[%~ IF data.streettype %][% address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' | html %][% END %]
-[%~ IF data.address %][% address = address _ data.address _ ' ' | html %][% END %]
-[%~ IF data.address2 %][% address = address _ data.address2 _ ' ' | html %][% END %]
-[%~ To.json( address ) | $raw ~%]
+[%~ IF data.streettype %][% SET address = address _ AuthorisedValues.GetByCode( 'ROADTYPE', data.streettype ) _ ' ' %][% END %]
+[%~ IF data.address %][% SET address = address _ data.address _ ' ' %][% END %]
+[%~ IF data.address2 %][% SET address = address _ data.address2 _ ' ' %][% END %]
+[%~ address | html | $To ~%]
our @cleanup;
subtest 'Search patrons' => sub {
our @cleanup;
subtest 'Search patrons' => sub {
my @patrons;
my $borrowernotes = q|<strong>just 'a" note</strong> \123 ❤|;
my $borrowernotes_displayed = q|just 'a" note \123 ❤|;
my $branchname = q|<strong>just 'another" library</strong> \123 ❤|;
my $firstname = q|<strong>fir's"tname</strong> \123 ❤|;
my @patrons;
my $borrowernotes = q|<strong>just 'a" note</strong> \123 ❤|;
my $borrowernotes_displayed = q|just 'a" note \123 ❤|;
my $branchname = q|<strong>just 'another" library</strong> \123 ❤|;
my $firstname = q|<strong>fir's"tname</strong> \123 ❤|;
+ my $address = q|<strong>add'res"s</strong> \123 ❤|;
my $patron_category = $builder->build_object(
{ class => 'Koha::Patron::Categories', category_type => 'A' } );
my $library = $builder->build_object(
my $patron_category = $builder->build_object(
{ class => 'Koha::Patron::Categories', category_type => 'A' } );
my $library = $builder->build_object(
categorycode => $patron_category->categorycode,
branchcode => $library->branchcode,
borrowernotes => $borrowernotes,
categorycode => $patron_category->categorycode,
branchcode => $library->branchcode,
borrowernotes => $borrowernotes,
like ($td[2]->get_text, qr[\Q$firstname\E],
'Column "Name" should be the 3rd and contain the firstname correctly filtered'
);
like ($td[2]->get_text, qr[\Q$firstname\E],
'Column "Name" should be the 3rd and contain the firstname correctly filtered'
);
+ like ($td[2]->get_text, qr[\Q$address\E],
+ 'Column "Name" should be the 3rd and contain the address correctly filtered'
+ );
is( $td[5]->get_text, $branchname,
'Column "Library" should be the 6th and contain the html tags - they have been html filtered'
);
is( $td[5]->get_text, $branchname,
'Column "Library" should be the 6th and contain the html tags - they have been html filtered'
);