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

(-)a/t/db_dependent/Serials/Claims.t (-2 / +12 lines)
Lines 1-5 Link Here
1
#!/usr/bin/perl
2
1
use Modern::Perl;
3
use Modern::Perl;
2
use Test::More tests => 17;
4
use Test::More tests => 18;
3
5
4
use C4::Acquisition;
6
use C4::Acquisition;
5
use C4::Budgets qw( AddBudgetPeriod AddBudget );
7
use C4::Budgets qw( AddBudgetPeriod AddBudget );
Lines 162-164 is( $serial_claimed->{claims_count}, 1, 'The serial should have been claimed' ); Link Here
162
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
164
my $today = output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 });
163
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format!
165
# FIXME: This test should pass. The GetLateOrMissingIssues should not deal with date format!
164
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' );
166
#is( $serial_claimed->{claimdate}, $today, 'The serial should have been claimed today' );
165
- 
167
168
subtest 'prevent SQL injections' => sub {
169
    plan tests => 1;
170
    my $time1 = time;
171
    my $hack  = q|1 OR (SELECT 1 FROM (SELECT(SLEEP(10)))x)-- -|;
172
    GetLateOrMissingIssues($hack);
173
    my $time2 = time;
174
    ok( $time2 < $time1 + 10, 'The sleep should not be executed' );
175
};

Return to bug 38829