protect some of the supercat browse interfaces from unboundedness
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Nov 2010 20:50:32 +0000 (20:50 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Nov 2010 20:50:32 +0000 (20:50 +0000)
E.g., browsing from a call number that contains forward slashes, e.g.,

"02/05/2004"

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_6_1@18887 dcc99617-32d9-48b4-a31d-7c20da2025e4

Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm

index a8f13af..068d5dd 100644 (file)
@@ -868,6 +868,7 @@ sub changes_feed {
        my ($type,$rtype,$axis,$limit,$date) = split '/', $path;
        my $flesh_feed = ($type =~ /-full$/o) ? 1 : 0;
        $limit ||= 10;
+       $limit = 10 if $limit !~ /^\d+$/;
 
        my $list = $supercat->request("open-ils.supercat.$rtype.record.$axis.recent", $date, $limit)->gather(1);
 
@@ -1319,6 +1320,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);
@@ -1385,6 +1387,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);