% $m->call_next;
-
<%init>
dbh->{'private_profile'} = {} if UNIVERSAL::can(dbh, 'sprintProfile');
</%init>
-
<%filter>
my $profile = '';
if ( UNIVERSAL::can(dbh, 'sprintProfile') ) {
- #if contenttype is text/html!! **FIXME**
+ if ( lc($r->content_type) eq 'text/html' ) {
+
+ # barely worth it, just in case someone tries to use profiling on a
+ # non-RT install
+ eval "use Text::Wrapper;";
+ die $@ if $@;
+
+ my $wrapper = new Text::Wrapper( columns => 80 );
- $profile = '<PRE>'. ("\n"x4096). encode_entities(dbh->sprintProfile()).
+ $profile = '<PRE>'.
+ encode_entities( $wrapper->wrap( dbh->sprintProfile() ) ).
#"\n\n". &sprintAutoProfile(). '</PRE>';
"\n\n". '</PRE>';
- #endif
+ }
dbh->{'private_profile'} = {};
}