Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: $TAINTED in latest CGI.pm v2.87

by particle (Vicar)
on Oct 09, 2002 at 15:17 UTC ( #203956=note: print w/replies, xml ) Need Help??


in reply to $TAINTED in latest CGI.pm v2.87

the warning is produced from the $ENV{REQUEST_METHOD} . ''. it seems $ENV{REQUEST_METHOD} is undefined, which causes the 'uninitialized value' message.

why the request method is not set, i'm not sure.

~Particle *accelerates*

Replies are listed 'Best First'.
Re: Re: $TAINTED in latest CGI.pm v2.87
by zentara (Archbishop) on Oct 09, 2002 at 15:28 UTC
    You are right. I went back and put CGI.pm v2.87 back in and added
    a line:
    $ENV{REQUEST_METHOD} = $ENV{REQUEST_METHOD} || '';
    
    $TAINTED = substr($ENV{REQUEST_METHOD}.'',0,0);
    
    and it works fine now.  There must be a better idiom for that added line ?
    

      how about

      $ENV{REQUEST_METHOD} ||= '';

      but it will replace a false value, such as the number 0. in perl6, that's better written as:

      $ENV{REQUEST_METHOD} //= '';

      which will only default undefined values

      ~Particle *accelerates*

      defined or $_ = '' for $ENV{REQUEST_METHOD};

      Makeshifts last the longest.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://203956]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (6)
As of 2022-11-30 11:26 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?