in reply to Yet Another Cargo Cult non-use of CGI.pm
in thread Upload Security (strip ../, etc.)

Actually, this in one of the few hand-rolled CGI parameter parsers I've seen which doesn't break multi-select fields (well, I suppose it might do if the values contained '|' characters - but it's still better than most!)

Your other points are spot on tho.

--
<http://www.dave.org.uk>

European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>
  • Comment on RE: Yet Another Cargo Cult non-use of CGI.pm

Replies are listed 'Best First'.
RE: RE: Yet Another Cargo Cult non-use of CGI.pm
by merlyn (Sage) on Aug 01, 2000 at 01:06 UTC
    Yeah, it breaks it with respect to vertical bars. My worry is that someone will copy that code without understanding, and either remove that line, or not understand the meaning of the vertical bar. (And splitting on vertical bars seems to be the one thing that beginners seem to constantly get wrong on the first few tries.)

    CGI::param gets it right. In a scalar context, you get back the first one seen. In a list context, you get them all. No confusion for either kind of user.

    -- Randal L. Schwartz, Perl hacker