[Rt-commit] r8853 - rt/branches/3.7-EXPERIMENTAL/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Fri Aug 31 07:27:59 EDT 2007


Author: ruz
Date: Fri Aug 31 07:27:57 2007
New Revision: 8853

Modified:
   rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm

Log:
* better handling of empty templates

Modified: rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm
==============================================================================
--- rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm	(original)
+++ rt/branches/3.7-EXPERIMENTAL/lib/RT/Template_Overlay.pm	Fri Aug 31 07:27:57 2007
@@ -297,7 +297,7 @@
 
     #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 @@
         @_
     );
 
-    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


More information about the Rt-commit mailing list