[open-ils-commits] r18888 - branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/WWW (gmc)
svn at svn.open-ils.org
svn at svn.open-ils.org
Tue Nov 30 15:50:53 EST 2010
Author: gmc
Date: 2010-11-30 15:50:48 -0500 (Tue, 30 Nov 2010)
New Revision: 18888
Modified:
branches/rel_1_6_0/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_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm
===================================================================
--- branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-11-30 20:50:32 UTC (rev 18887)
+++ branches/rel_1_6_0/Open-ILS/src/perlmods/OpenILS/WWW/SuperCat.pm 2010-11-30 20:50:48 UTC (rev 18888)
@@ -858,6 +858,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);
@@ -1309,6 +1310,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);
@@ -1375,6 +1377,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