fix 'Can't call method "setup" on an undefined value' error when using into rates...
[freeside.git] / htetc / handler.pl
index 94377cf..e065f09 100644 (file)
@@ -44,8 +44,8 @@ sub handler
 
     ###Module::Refresh->refresh;###
 
-    #$r->content_type('text/html; charset=utf-8');
-    $r->content_type('text/html; charset=iso-8859-1');
+    $r->content_type('text/html; charset=utf-8');
+    #$r->content_type('text/html; charset=iso-8859-1');
     #eorar
 
     my $headers = $r->headers_out;
@@ -57,16 +57,17 @@ sub handler
 
     if ( $r->filename =~ /\/rt\// ) { #RT
 
-      $ah->interp($rt_interp);
+      # We don't need to handle non-text, non-xml items
+      return -1 if defined( $r->content_type )
+                && $r->content_type !~ m!(^text/|\bxml\b)!io;
+
 
       local $SIG{__WARN__};
       local $SIG{__DIE__};
 
       RT::Init();
 
-      # We don't need to handle non-text, non-xml items
-      return -1 if defined( $r->content_type )
-                && $r->content_type !~ m!(^text/|\bxml\b)!io;
+      $ah->interp($rt_interp);
 
     } else {