in reply to Controlling Inputted Paths in a CGI Script
However if you are willing to say, "I don't care about all legal file names", my files will be limited to alphanumeric, underscore, space, dash, slash and dot. (Which seems reasonable). Then remove everything else and eliminate multiple dots.
$file =~ s@[^\w/. -]@@g; $file =~ s/\.+/./g;
|
|---|