I get errors if I try to search or edit the wiki, e.g.
  http://cgi-app.org/index.cgi?action=edit&page_name=CGIpmAlternatives

I sent email to [email protected] but it bounced.


I wanted to make a note on the wiki about a difference I found between
CGI::Simple and normal CGI.
I'm using apache mod_rewrite and PATH_INFO to get "clean URLs", e.g.
 http://mysite.com/account/edit
turns into a call to account.cgi, and runmode "edit" is executed.

I was also guarding against cross site scripting by doing something like the
following
sub edit {
   ...
   if($self->query->url_param > 0)  {  error condition, looks like x-site
scripting }

With CGI::Simple, the above works.

I recently switched over to Fast::CGI and following the wiki instructions
  http://cgi-app.org/index.cgi?FastCGI
I'm no longer using CGI::Simple.

The above "if" statement started triggering in my unit test code.

url_param() is returning a parameter named "keywords".  I finally tracked
this down to "If the script was invoked as an <ISINDEX> script and contains
a string without ampersands (e.g. "value1+value2+value3") , there will be a
single parameter named "keywords" containing the "+"-delimited keywords."

I guess this is because I'm using PATH_INFO... not sure.  CGI::Simple
doesn't return a "keywords" param, but CGI.pm does.

So, the fix is
   if($self->query->url_param > 1)  {  error condition }
    # note, param "keywords" is present when using CGI.pm, but not when
using CGI::Simple

-- Mark

#####  CGI::Application community mailing list  ################
##                                                            ##
##  To unsubscribe, or change your message delivery options,  ##
##  visit:  http://www.erlbaum.net/mailman/listinfo/cgiapp    ##
##                                                            ##
##  Web archive:   http://www.erlbaum.net/pipermail/cgiapp/   ##
##  Wiki:          http://cgiapp.erlbaum.net/                 ##
##                                                            ##
################################################################

Reply via email to