G
Gary Mayor
Hi,
I'm getting a filename from a user then copying a file to a new file
with the new filename specified by the user. So the script is like this
$file = param("file");
system("cp $from $file");
I need to check the $file string for any invalid characters such as ../
@ |. I can do a regex expression to check them but I was hopeing someone
had already done the expressions what would be all the characters I
would need to check for security reasons?
Sample Regex
$file=~/\.|\..|\/|\@/)
Is there a better way
Ideas Please?
Thanks
Gary
I'm getting a filename from a user then copying a file to a new file
with the new filename specified by the user. So the script is like this
$file = param("file");
system("cp $from $file");
I need to check the $file string for any invalid characters such as ../
@ |. I can do a regex expression to check them but I was hopeing someone
had already done the expressions what would be all the characters I
would need to check for security reasons?
Sample Regex
$file=~/\.|\..|\/|\@/)
Is there a better way
Ideas Please?
Thanks
Gary