GeoHelm/legacy/save_files.cgi

22 lines
447 B
Plaintext
Raw Normal View History

2024-01-27 19:04:46 +00:00
#!/usr/bin/perl
require './geohelm-lib.pl';
&error_setup($text{'manual_err'});
&ReadParseMime();
my $files_home = '/var/www/html';
if( (index($in{'file'}, $files_home) != 0) || (! -f $in{'file'}) ){
&error($text{'source_err0'});
}
$in{'data'} =~ s/\r//g;
$in{'data'} =~ /\S/ || &error($text{'manual_edata'});
# Write to it
&open_lock_tempfile(DATA, ">$in{'file'}");
&print_tempfile(DATA, $in{'data'});
&close_tempfile(DATA);
&redirect("");