X-Git-Url: http://git.rot13.org/?p=BackupPC.git;a=blobdiff_plain;f=lib%2FBackupPC%2FCGI%2FRestoreFile.pm;h=e5b316a76c4ad1eed48d97be38f5a2362a09b89e;hp=dfce7ef669f46330ffe635d476ef9e521b1322bf;hb=c2b072c9ad558447fb73fedf0cad170214b7d80e;hpb=4cdaa6b8a9f5161ee2da4371d68cbbad41248ea0 diff --git a/lib/BackupPC/CGI/RestoreFile.pm b/lib/BackupPC/CGI/RestoreFile.pm index dfce7ef..e5b316a 100644 --- a/lib/BackupPC/CGI/RestoreFile.pm +++ b/lib/BackupPC/CGI/RestoreFile.pm @@ -28,7 +28,7 @@ # #======================================================================== # -# Version 3.0.0beta0, released 11 Jul 2006. +# Version 3.0.0, released 28 Jan 2007. # # 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;