Code

handle bogus pagination values (issue 2550530)
authorrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 17 Mar 2009 22:59:40 +0000 (22:59 +0000)
committerrichard <richard@57a73879-2fb5-44c3-a270-3262357dd7e2>
Tue, 17 Mar 2009 22:59:40 +0000 (22:59 +0000)
git-svn-id: http://svn.roundup-tracker.org/svnroot/roundup/roundup/trunk@4207 57a73879-2fb5-44c3-a270-3262357dd7e2

CHANGES.txt
roundup/cgi/templating.py

index fef50e946c6aeadebcab5e651198e949f25ab043..56a4e2637d566665d98949d015d7770f489af28c 100644 (file)
@@ -6,6 +6,7 @@ are given with the most recent entry first.
 Fixes:
 - bug introduced into CVS export and view
 - bugs introduced in the migration to the email package (issue 2550531)
+- handle bogus pagination values (issue 2550530)
 
 
 2009-03-13 1.4.7 (r4202)
index 17912c6d9f5783586c6c3124d55669b821e8b906..f536774b4215b0a7e0e04ff540bc2117310c8226 100644 (file)
@@ -1131,7 +1131,7 @@ class _HTMLItem(HTMLInputMixin, HTMLPermissions):
         # The context for a search page should be the class, not any
         # node.
         self._client.nodeid = None
-        
+
         # use our fabricated request
         return pt.render(self._client, req.classname, req)
 
@@ -1959,7 +1959,7 @@ class LinkHTMLProperty(HTMLProperty):
                 else:
                     fn = lambda optionid: linkcl.get(optionid, propname)
             additional_fns.append(fn)
-            
+
         for optionid in options:
             # get the option value, and if it's None use an empty string
             option = linkcl.get(optionid, k) or ''
@@ -2147,7 +2147,7 @@ class MultilinkHTMLProperty(HTMLProperty):
             for opt in linkcl.filter(None, conditions, sort_on)
             if self._db.security.hasPermission("View", self._client.userid,
                 linkcl.classname, itemid=opt)]
-        
+
         # make sure we list the current values if they're retired
         for val in value:
             if val not in options:
@@ -2180,7 +2180,7 @@ class MultilinkHTMLProperty(HTMLProperty):
                 else:
                     fn = lambda optionid: linkcl.get(optionid, propname)
             additional_fns.append(fn)
-            
+
         for optionid in options:
             # get the option value, and if it's None use an empty string
             option = linkcl.get(optionid, k) or ''
@@ -2399,13 +2399,21 @@ class HTMLRequest(HTMLInputMixin):
         for name in ':pagesize @pagesize'.split():
             if self.form.has_key(name):
                 self.special_char = name[0]
-                self.pagesize = int(self.form.getfirst(name))
+                try:
+                    self.pagesize = int(self.form.getfirst(name))
+                except ValueError:
+                    # not an integer - ignore
+                    pass
 
         self.startwith = 0
         for name in ':startwith @startwith'.split():
             if self.form.has_key(name):
                 self.special_char = name[0]
-                self.startwith = int(self.form.getfirst(name))
+                try:
+                    self.startwith = int(self.form.getfirst(name))
+                except ValueError:
+                    # not an integer - ignore
+                    pass
 
         # dispname
         if self.form.has_key('@dispname'):