From: Rob H. <for...@us...> - 2002-07-29 17:41:47
|
Update of /cvsroot/sandweb/sandweb/lib/SandWeb In directory usw-pr-cvs1:/tmp/cvs-serv19096/lib/SandWeb Modified Files: Browse.pm Log Message: checks for unsafe HTTP characters in filenames - rf. RFC 2068 http://www.w3c.org/Protocols/rfc2068/rfc2068 This means that you can view and manipulate .# files.. yay :) Index: Browse.pm =================================================================== RCS file: /cvsroot/sandweb/sandweb/lib/SandWeb/Browse.pm,v retrieving revision 1.77 retrieving revision 1.78 diff -U2 -r1.77 -r1.78 --- Browse.pm 19 Jun 2002 07:08:59 -0000 1.77 +++ Browse.pm 29 Jul 2002 17:41:41 -0000 1.78 @@ -121,4 +121,13 @@ ); my $filename = $file->get_filename(); + + # sanitize filename for HTTP + #Unsafe Characters; RFC 2068 + $filename =~ s/%/%25/g; + $filename =~ s/"/%22/g; + $filename =~ s/#/%23/g; + $filename =~ s/</%3C/g; + $filename =~ s/>/%3E/g; + $row_data{FILESIZE} = $file->get_size(); $row_data{FILEAGE} = $file->get_age(); |