[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cgi-list
Subject:    Re: [CGI] Rewrite the QUERY_STRING (args) for mod_perl?
From:       Tommy Butler <tommy () atrixnet ! com>
Date:       2003-05-16 7:11:39
[Download RAW message or body]

Jann Linder wrote:

> I have a modperl PerlTransHandler defined in httpd.conf
> 
> This is actually very handy cos I do some neat stuff before anything on the
> site runs...however, I want to catch and block a variable that seems to get
> passed with some scripts.
> 
> Lets say this variable is LOGOUT=1
> 
> Here is my PerlTransHandler
> 
> <perlcode>
> package PTH;
> use Apache::Constants qw(OK DECLINED);
> 
> sub handler
> {
> 
> my $r = shift();
> return DECLINED unless $r->is_main; # Don't handle sub requests
> my %args = $r->args;
> if (exists $args{LOGOUT})
> {
> delete $args{LOGOUT};
> }
> return DECLINED;
> }
> 
> 
> </perlcode>

How about...

<perlcode>

$ENV{'QUERY_STRING'} =~ s/(?<=\?|\;|\&)LOGOUT=1(?=\;|\&)//g;

</perlcode>

-- 

   -Tommy Butler
    see if I'm online »http://ooopps.sourceforge.net/online

    Tommy Butler <tommy@atrixnet.com>
    phone: (817)-468-7716
    6711 Forest Park Dr
    Arlington, TX
         76001-8403

    Download my résumé in PDF, MS Word, HTML, text
    http://www.atrixnet.com/

    the ooOPps Code Library
    http://ooopps.sourceforge.net/pub/


--
To unusbcribe, send an email contining the words: 'unsubscribe cgi-list' to the \
following email address: majordomo@jann.com

Archives of the following mailing lists are available at: http://www.perl.jann.com/
the CGI Mailing List
the mod_perl mailing list
the embperl mailing list
Searching, browsing and posting are available at http://www.perl.jann.com/


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic