diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 53d696984..f2a2fc38f 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -14,6 +14,7 @@ - fix: A newly released version of Html::Template fixes a bug with global variables and nested loops. testEnvironment.pl has been updated to require that it be used. + - fix: Image in trash though visible in article - fix: Direct 6.8.10-7.2+ Upgrade Problem diff --git a/lib/WebGUI/Asset/File.pm b/lib/WebGUI/Asset/File.pm index ee431d21f..3c9664c35 100644 --- a/lib/WebGUI/Asset/File.pm +++ b/lib/WebGUI/Asset/File.pm @@ -401,9 +401,18 @@ sub exportHtml_view { return 'chunked'; } +#-------------------------------------------------------------------- sub www_view { my $self = shift; return $self->session->privilege->noAccess() unless $self->canView; + + # Check to make sure it's not in the trash or some other weird place + my $state = $self->get("state"); + if ($state ne "published" && $state ne "archived") { + my $i18n = WebGUI::International->new($self->session,'Asset_File'); + $self->session->http->setStatus("404"); + return sprintf($i18n->get("file not found"), $self->getUrl()); + } $self->session->http->setRedirect($self->getFileUrl); $self->session->http->setStreamedFile($self->getStorageLocation->getPath($self->get("filename"))); diff --git a/lib/WebGUI/i18n/English/Asset_File.pm b/lib/WebGUI/i18n/English/Asset_File.pm index dece2121d..b6d7c5830 100644 --- a/lib/WebGUI/i18n/English/Asset_File.pm +++ b/lib/WebGUI/i18n/English/Asset_File.pm @@ -146,6 +146,18 @@ our $I18N = { lastUpdated => 1166824158, }, + 'file not found' => { + message => q| +
++ + |, + lastUpdated => 0, + }, + }; 1;