From: gmc Date: Tue, 30 Nov 2010 20:43:55 +0000 (+0000) Subject: protect some of the supercat browse interfaces from unboundedness X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=186fb681c9602c204725b62df92e1cac2fa7dcd9;p=evergreen%2Fmasslnc.git protect some of the supercat browse interfaces from unboundedness E.g., browsing from a call number that contains forward slashes, e.g., "02/05/2004" Signed-off-by: Galen Charlton git-svn-id: svn://svn.open-ils.org/ILS/trunk@18884 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm index 88c17f3fd1..305b8a26be 100644 --- a/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm +++ b/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm @@ -986,6 +986,7 @@ sub changes_feed { my $flesh_feed = parse_feed_type($type); $limit ||= 10; + $limit = 10 if $limit !~ /^\d+$/; my $list = $supercat->request("open-ils.supercat.$rtype.record.$axis.recent", $date, $limit)->gather(1); @@ -1439,6 +1440,7 @@ sub string_browse { $page_size ||= $cgi->param('count') || 9; $page = 0 if ($page !~ /^-?\d+$/); + $page_size = 9 if $page_size !~ /^\d+$/; my $prev = join('/', $base,$format,$axis,$site,$string,$page - 1,$page_size); my $next = join('/', $base,$format,$axis,$site,$string,$page + 1,$page_size); @@ -1503,6 +1505,7 @@ sub string_startwith { $page_size ||= $cgi->param('count') || 9; $page = 0 if ($page !~ /^-?\d+$/); + $page_size = 9 if $page_size !~ /^\d+$/; my $prev = join('/', $base,$format,$axis,$site,$string,$page - 1,$page_size); my $next = join('/', $base,$format,$axis,$site,$string,$page + 1,$page_size); @@ -1573,6 +1576,7 @@ sub item_age_browse { $page_size ||= $cgi->param('count') || 10; $page = 1 if ($page !~ /^-?\d+$/ || $page < 1); + $page_size = 10 if $page_size !~ /^\d+$/; my $prev = join('/', $base,$format,$axis,$site,$page - 1,$page_size); my $next = join('/', $base,$format,$axis,$site,$page + 1,$page_size);