fixed: Gallery now gives an error message when a Zip archive is being naughty

This commit is contained in:
Doug Bell 2008-08-11 20:18:31 +00:00
parent edb0f2f622
commit 980dc18831
3 changed files with 14 additions and 2 deletions

View file

@ -13,6 +13,7 @@
- fixed: Gallery navigation back to album returns to page 1 (Martin
Kamerbeek / Oqapi)
- fixed: WSClient now correctly handles SOAP::Som returns of simple arrays of scalars and a exception producing if test turned into an eval.
- fixed: Gallery now gives an error message when a Zip archive is being naughty
7.5.19
- fixed: paginator doesn't show correct number of page links with a limit applied

View file

@ -103,7 +103,7 @@ sub addArchive {
my $archive = Archive::Any->new( $filename );
croak "Archive will extract to directory outside of storage location!"
die "Archive will extract to directory outside of storage location!\n"
if $archive->is_naughty;
my $tempdirName = tempdir( "WebGUI-Gallery-XXXXXXXX", TMPDIR => 1, CLEANUP => 1);
@ -882,7 +882,12 @@ sub www_addArchiveSave {
}
my $filename = $storage->getPath( $storage->getFiles->[0] );
$self->addArchive( $filename, $properties );
eval { $self->addArchive( $filename, $properties ) };
if ( my $error = $@ ) {
return $self->www_addArchive({
error => sprintf( $i18n->get('addArchive error generic'), $error ),
});
}
$storage->delete;

View file

@ -311,6 +311,12 @@ our $I18N = {
lastUpdated => 0,
},
'addArchive error generic' => {
message => 'There was an error uploading your archive: %s',
lastUpdated => 0,
context => 'Lead in to an error message from WebGUI',
},
'template url_addPhoto' => {
message => 'Add a Photo',
lastUpdated => 0,