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

(-)a/circ/reserveratios.pl (-5 / +7 lines)
Lines 21-33 Link Here
21
use strict;
21
use strict;
22
use warnings;
22
use warnings;
23
23
24
use CGI;
25
use Date::Calc qw/Today Add_Delta_YM/;
26
24
use C4::Context;
27
use C4::Context;
25
use C4::Output;
28
use C4::Output;
26
use CGI;
27
use C4::Auth;
29
use C4::Auth;
28
use C4::Dates qw/format_date format_date_in_iso/;
30
use C4::Dates qw/format_date format_date_in_iso/;
29
use C4::Debug;
31
use C4::Debug;
30
use Date::Calc qw/Today Add_Delta_YM/;
31
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
32
use C4::Biblio qw/GetMarcBiblio GetRecordValue GetFrameworkCode/;
32
33
33
my $input = new CGI;
34
my $input = new CGI;
Lines 61-70 if (!defined($startdate) or $startdate !~ s/^\s*(\S+)\s*$/$1/) { # strip space Link Here
61
if (!defined($enddate)   or $enddate   !~ s/^\s*(\S+)\s*$/$1/) {   # strip spaces, remove Taint
62
if (!defined($enddate)   or $enddate   !~ s/^\s*(\S+)\s*$/$1/) {   # strip spaces, remove Taint
62
	$enddate   = format_date($todaysdate);
63
	$enddate   = format_date($todaysdate);
63
}
64
}
64
if (!defined($ratio)     or $ratio     !~ s/^\s*(0?\.?\d+)(\.0*)?\s*$/$1/) {   # strip spaces, remove Taint
65
if (!defined($ratio)) {
65
	$ratio = 3;
66
	$ratio = 3;
66
}
67
}
67
if ($ratio == 0) {
68
# Force to be a number
69
$ratio += 0;
70
if ($ratio <= 0) {
68
    $ratio = 1; # prevent division by zero
71
    $ratio = 1; # prevent division by zero
69
}
72
}
70
73
71
- 

Return to bug 6724