]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
Fixed different File handling of IE7 and FF (Fullpath and Filename)
authormaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sun, 28 Oct 2007 08:34:42 +0000 (08:34 +0000)
committermaniacikarus <maniacikarus@ea5c0bd1-69bd-2848-81d8-4f18e57aeed8>
Sun, 28 Oct 2007 08:34:42 +0000 (08:34 +0000)
git-svn-id: http://svn.ipfire.org/svn/ipfire/trunk@1016 ea5c0bd1-69bd-2848-81d8-4f18e57aeed8

html/cgi-bin/backup.cgi

index 0e29ace5fda2fce8cdc97c5e1d5a40c23b618d4f..c14e3f09d4127fb1a54d4d9d994146760695bbe1 100644 (file)
@@ -88,14 +88,17 @@ elsif ( $cgiparams{'ACTION'} eq "restore" )
 }
 elsif ( $cgiparams{'ACTION'} eq "restoreaddon" )
 {
+    chomp($cgiparams{'UPLOAD'});
+    # we need to fix cause IE7 gives the full path and FF only the filename
+    my @temp = split(/\\/,$cgiparams{'UPLOAD'});
                my $upload = $a->param("UPLOAD");
-               open UPLOADFILE, ">/tmp/$cgiparams{'UPLOAD'}";
+               open UPLOADFILE, ">/tmp/".$temp[$#temp];
                binmode $upload;
                while ( <$upload> ) {
                print UPLOADFILE;
                }
                close UPLOADFILE;
-               system("/usr/local/bin/backupctrl restoreaddon $cgiparams{'UPLOAD'} >/dev/null 2>&1");
+               system("/usr/local/bin/backupctrl restoreaddon ".$temp[$#temp]." >/dev/null 2>&1");
 }
 
 &Header::showhttpheaders();
@@ -270,8 +273,8 @@ print "</table>";
 print <<END
 <table width='95%' cellspacing='0'>
 <tr><td align='center' colspan='2'><font color='red'><br />$Lang::tr{'backupwarning'}</font><br /><br /></td></tr>
-<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
-<tr><td align='left'>$Lang::tr{'backupaddon'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restoreaddon' /><input type='hidden' name='FILE' value='$_' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backup'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restore' /><input type='hidden' name='FILE' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
+<tr><td align='left'>$Lang::tr{'backupaddon'}</td><td align='left'><form method='post' enctype='multipart/form-data' action='$ENV{'SCRIPT_NAME'}'><input type="file" size='50' name="UPLOAD" /><input type='hidden' name='ACTION' value='restoreaddon' /><input type='hidden' name='FILE' /><input type='image' alt='$Lang::tr{'restore'}' title='$Lang::tr{'restore'}' src='/images/media-floppy.png' /></form></td></tr>
 </table>
 END
 ;