X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FRestoreFile.pm;h=e0fbe677ed96c3283576446ac4d3de9db9374fdf;hp=d8d1b9507ef8c8859ed416079081a9bdd7aaf787;hb=refs%2Ftags%2Fv3_0_0beta1;hpb=d13d57e035dac9362ca393991b978530402969b7 diff --git a/lib/BackupPC/CGI/RestoreFile.pm b/lib/BackupPC/CGI/RestoreFile.pm index d8d1b95..e0fbe67 100644 --- a/lib/BackupPC/CGI/RestoreFile.pm +++ b/lib/BackupPC/CGI/RestoreFile.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 2.1.0, released 20 Jun 2004. +# Version 3.0.0beta1, released 30 Jul 2006. # # See http://backuppc.sourceforge.net. # @@ -37,11 +37,13 @@ package BackupPC::CGI::RestoreFile; use strict; +use Encode; use BackupPC::CGI::Lib qw(:all); use BackupPC::FileZIO; use BackupPC::Attrib qw(:all); use BackupPC::View; + sub action { restoreFile($In{host}, $In{num}, $In{share}, $In{dir}); @@ -150,7 +152,8 @@ sub restoreFile my $view = BackupPC::View->new($bpc, $host, \@Backups); my $a = $view->fileAttrib($num, $share, $dir); if ( $dir =~ m{(^|/)\.\.(/|$)} || !defined($a) ) { - ErrorExit("Can't restore bad file ${EscHTML($dir)} ($num, $share, $dir)"); + $dir = decode_utf8($dir); + ErrorExit("Can't restore bad file ${EscHTML($dir)} ($num, $share)"); } my $f = BackupPC::FileZIO->open($a->{fullPath}, 0, $a->{compress}); my $data;