I have a small problem, and a possible hack to fix it, and want to
solicit comments.

In particular, I'm concerned that I'm doing something boneheaded
thats' leading to my problem and my machinations are wasted effort.

I have a run mode named 'browse' that takes a page parameter (it's
displaying a large dataset a page at a time).  People generally page
around w/ first/previous/next/last links that encode page numbers in
the URL.

For paranoia's sake, I'd like to check that the page parameter is
valid, e.g. an integer > 0.

Since I'm using ValidateRM to check all sorts of other things, I
thought I could use it here, with the call to check_rm just returning
me to the browse runmode.  The problem is that the page parameter is
still invalid on the next call to the runmode and it recurses
tragically.

I suppose that I could have the URL point to one run mode and the call
to check_rm point to another that cleans up the parameter list and
does a forward.

It also occurred to me that it might be interesting to add a small
feature to ValidateRM in which it cleans up any/specific invalid
parameters from $self->query before it invokes the runmode.  I've
hardcoded a couple of test cases and it seems to work.

So, the proposal would be to add a couple of lines of code to
CAP::ValidateRM that would clean up invalid parameters.

I'm not sure how to best specify the list of candidate cleanees.  One
could remove any invalid params, one could check to see if there's an
ignore_fields key in the FIF params and use it's contents?

Thanks for any input,

g.

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to