[seti total_junk][perl] delete $Scratch->{violation}; $_ = delete $Session->{arg}; $Scratch->{violation} = 'No .. allowed in file name.' if m{\.\./}; $Scratch->{violation} = 'No | allowed.' if m{\|}; $Scratch->{violation} = 'No whitespace allowed.' if m{\s}; $Scratch->{violation} = 'No drive letters!' if m{^\s*[a-zA-Z]:/}; $Scratch->{violation} = 'No absolute file paths allowed.' if s{^/}{}; if($Scratch->{violation}) { Log (<{username} $Session->{host} EOF } else { $Scratch->{file_to_view} = $_; } if(/\.gif$/i) { $Scratch->{content_type} = 'image/gif'; } elsif(/\.jpe?g$/i) { $Scratch->{content_type} = 'image/jpeg'; } elsif(/\.png$/i) { $Scratch->{content_type} = 'image/png'; } else { $Scratch->{content_type} = 'text/plain'; } return; [/perl][if scratch violation] [seti ui_error][scratch violation] -- logged.[/seti] [bounce page="__UI_BASE__/error"] [else] [tag op=header interpolate=1]Content-Type: [scratch content_type][set content_type][/set][/tag] [/else] [/if] [/seti][file name="[scratch file_to_view]" type="[value download_conversion]" ][goto end=1 abort=1]