Commit 90f5fd27 authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

better handling of empty templates

git-svn-id: svn+ssh://svn.bestpractical.com/svn/bps-public/rt/branches/3.7-EXPERIMENTAL@8853 e417ac7c-1bcc-0310-8ffa-8f5827389a85
parent e19649b8
......@@ -297,7 +297,7 @@ sub Parse {
#We're passing in whatever we were passed. it's destined for _ParseContent
my ($content, $msg) = $self->_ParseContent(@_);
return ( 0, $msg ) unless defined $content;
return ( 0, $msg ) unless defined $content && length $content;
#Lets build our mime Entity
......@@ -347,9 +347,13 @@ sub _ParseContent {
@_
);
my $content = $self->Content;
unless ( defined $content ) {
return ( undef, $self->loc("Permissions denied") );
unless ( $self->CurrentUserHasQueueRight('ShowTemplate') ) {
return (undef, $self->loc("Permissions denied"));
}
my $content = $self->SUPER::_Value('Content');
unless ( defined $content && length $content ) {
return ( '', $self->loc("Template is empty") );
}
# We need to untaint the content of the template, since we'll be working
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment