From: Michael G. <ga...@ma...> - 2006-07-21 01:14:31
|
> > I tried attacking this from the other angle -- delete all the > params from the CGI object before any form field functions can be > called. This makes all requests (GET and POST) under both versions > of Apache behave like POST requests under Apache 1. As far as I can > tell, this is working. Plus, it's a much less invasive solution > than CGIParamShim or CGIeasytags -- it's pretty much a one-liner in > a subclass. > > I've added it as WeBWorK::CGIDeleteParams. I also added it as an > alternative in WeBWorK::CGI. It needs additional testing, which I > will give it as I continue porting efforts. > I thought of that but I was afraid that would mean disabling the $r- >param() function as well. How do you keep $r->param from being affected? >> I haven't been doing >> lots of testing with the standard CGI -- are you still getting >> weird behavior a lot of the time? > > Yeah, CGIParamShim wasn't really solving the problem. But > CGIDeleteParams seems to so far. > Good. >> We could also decide to go with CGIeasytags. If the extra {} are >> bothering you, we can >> be a bit more clever about deciding whether the input to CGI::foo >> () is of the form: >> (1) CGI::foo({params], text] -- easy >> (2) CGI::foo(-name=>'foo', value = >'bar') or >> (3) CGI:: foo( "name", "foo", "value", "bar") i.e. is supposed >> to produce namefoovaluebar >> (4)CGI::foo("foo", "bar"); >> >> Nothing would be perfect but one could do a lot more than I tried to. > > The extra {} are a bit annoying, but what really bugs me about > CGIeasytags is that you've had to reimplement parts of CGI (and > CGI::Util) to make it compatible with how we've been calling CGI > functions. > Yep. I wasn't happy as things went that way either. I think I kept the rules so that they were a slightly more rigid version of the original CGI rules fewer special cases. > I just recently discovered the rearrange function in CGI::Util. It > does most of the parameter munging for the CGI functions, and > handles all four of the forms you list above. For example, here's > the call in CGI::hidden: > > my($name,$default,$override,@other) = > rearrange([NAME,[DEFAULT,VALUE,VALUES],[OVERRIDE,FORCE]],@p); > I'll keep that in mind. I hadn't looked at that function -- it might well make CGIeasytags even more CGI compatible. I'll take a look at it if it's needed. let's see how this deleteparameter patch goes. > If you think CGI::EasyTags is the way to go, you might consider > replacing the parameter parsing with calls to rearrange. Good idea. > -sam Take care, Mike |