[open-ils-commits] r18886 - branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW (gmc)

svn at svn.open-ils.org svn at svn.open-ils.org
Tue Nov 30 15:50:07 EST 2010


Author: gmc
Date: 2010-11-30 15:50:02 -0500 (Tue, 30 Nov 2010)
New Revision: 18886

Modified:
   branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
Log:
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 <gmc at esilibrary.com>

Modified: branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-11-30 20:44:31 UTC (rev 18885)
+++ branches/rel_1_6/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm	2010-11-30 20:50:02 UTC (rev 18886)
@@ -876,6 +876,7 @@
 	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);
 
@@ -1327,6 +1328,7 @@
 	$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);
@@ -1393,6 +1395,7 @@
 	$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);



More information about the open-ils-commits mailing list