Image in trash though visible in article
This commit is contained in:
parent
3df71a5351
commit
8a722e9ae1
3 changed files with 22 additions and 0 deletions
|
|
@ -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")));
|
||||
|
|
|
|||
|
|
@ -146,6 +146,18 @@ our $I18N = {
|
|||
lastUpdated => 1166824158,
|
||||
},
|
||||
|
||||
'file not found' => {
|
||||
message => q|<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
|
||||
<HTML><HEAD>
|
||||
<TITLE>404 Not Found</TITLE>
|
||||
</HEAD><BODY>
|
||||
<H1>Not Found</H1>
|
||||
The requested URL %s was not found on this server.<P>
|
||||
</BODY></HTML>
|
||||
|,
|
||||
lastUpdated => 0,
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue