View | Details | Raw Unified | Return to bug 22836
Collapse All | Expand All

(-)a/t/db_dependent/selenium/regressions.t (-4 / +2 lines)
Lines 188-194 subtest 'Display circulation table correctly' => sub { Link Here
188
};
188
};
189
189
190
subtest 'XSS vulnerabilities in pagination' => sub {
190
subtest 'XSS vulnerabilities in pagination' => sub {
191
    plan tests => 4;
191
    plan tests => 3;
192
192
193
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
193
    my $patron = $builder->build_object({ class => 'Koha::Patrons' });
194
    for ( 1 .. 30 ) { # We want the pagination to be displayed
194
    for ( 1 .. 30 ) { # We want the pagination to be displayed
Lines 228-235 subtest 'XSS vulnerabilities in pagination' => sub { Link Here
228
    is( $alert_text, undef, 'No alert box displayed, even if evil intent' );
228
    is( $alert_text, undef, 'No alert box displayed, even if evil intent' );
229
229
230
    my $second_page = $driver->find_element('//div[@class="pages"]/span[@class="currentPage"]/following-sibling::a');
230
    my $second_page = $driver->find_element('//div[@class="pages"]/span[@class="currentPage"]/following-sibling::a');
231
    unlike( $second_page->get_attribute('href'), qr{%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second page link should not contain any script tags (escaped or otherwise)' );
231
    like( $second_page->get_attribute('href'), qr{category=1%22%3E%3Cscript%3Ealert%28%27booh%21%27%29%3C%2Fscript%3E}, 'The second patch should displayed the variables and attributes correctly URI escaped' );
232
    unlike( $second_page->get_attribute('href'), qr{"<script>alert('booh!')</script>}, 'The second page link should not contain any script tags (escaped or otherwise)' );
233
232
234
    push @cleanup, $patron, $patron->category, $patron->library;
233
    push @cleanup, $patron, $patron->category, $patron->library;
235
};
234
};
236
- 

Return to bug 22836