Re: Getting forward slashes and hyphins past the taint check

[email protected] (Robert Roggenbuck) Wed, 10 Mar 2010 11:03:01 +0100
Newsgroups perl.beginners.cgi
Message-ID <[email protected]>
Move the hyphen to the end (only):

if ( $Cookie_path =~ /^([\@\w\/.-]+)$/ ) {

Greetings

Robert


Adam Jimerson schrieb:
> In one of my scripts that I am developing I have a field where the needs 
> to supply which my include forward slashes and hyphens.  I understand the 
> inherent security risk of allowing such things and so does the taint 
> check...  I'm sure the answer to this is really simple and I'm just over 
> looking it (or even over complicating things) but here is what I have 
> tired to get it to work:
> 
> if ( $Cookie_path =~ /^([-\@\w\/\-.]+)$/ ) {
> 	$Cookie_path = $1;
> } else {
> 	die "Incorrect format";
> }