mt2k has asked for the wisdom of the Perl Monks concerning the following question:
if ($string =~ /$input{'variable'}/gis) { #Some processing }
The $input{'variable'} variable would be a value entered from a textfield from a CGI script.
I don't think entering commands does anything, but I noticed that you can enter special characters, such as charater classes, parentheses, periods, carets, and dollar signs. So is there any danger of files being deleted, or anything else I would want to class as bad?? Or would it just allow some nice restrictions for a search engine??
So if it is dangerous somehow, I should use:
right??if ($string =~ /\Q$input{'variable'}/) { #blah blah blah... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Regex Dangerous??
by merlyn (Sage) on Mar 23, 2001 at 04:52 UTC | |
|
Re: Regex Dangerous??
by mt2k (Hermit) on Mar 23, 2001 at 04:50 UTC | |
by merlyn (Sage) on Mar 23, 2001 at 04:55 UTC |