protect some of the supercat browse interfaces from unboundedness
authorgmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Nov 2010 20:43:55 +0000 (20:43 +0000)
committergmc <gmc@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 30 Nov 2010 20:43:55 +0000 (20:43 +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/trunk@18884 dcc99617-32d9-48b4-a31d-7c20da2025e4

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

index 88c17f3..305b8a2 100644 (file)
@@ -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);