[Rt-commit] r17203 - in rt/3.8/trunk/share/html: Elements

sunnavy at bestpractical.com sunnavy at bestpractical.com
Fri Dec 12 19:11:40 EST 2008


Author: sunnavy
Date: Fri Dec 12 19:11:40 2008
New Revision: 17203

Modified:
   rt/3.8/trunk/share/html/Elements/MakeClicky
   rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments

Log:
makeclicky for html

Modified: rt/3.8/trunk/share/html/Elements/MakeClicky
==============================================================================
--- rt/3.8/trunk/share/html/Elements/MakeClicky	(original)
+++ rt/3.8/trunk/share/html/Elements/MakeClicky	Fri Dec 12 19:11:40 2008
@@ -125,20 +125,28 @@
 </%ONCE>
 <%ARGS>
 $content => undef
+$html => undef
 </%ARGS>
 <%INIT>
 return unless defined $$content;
 unless ( $regexp ) {
-    RT::Interface::Web::EscapeUTF8( $content );
+    RT::Interface::Web::EscapeUTF8( $content ) unless $html;
     return;
 }
 
 my $pos = 0;
 while ( $$content =~ /($regexp)/gsio ) {
     my $match = $1;
+    next if $` =~ /href=(?:&quot;|")$/;
     my $skipped_len = pos($$content) - $pos - length($match);
     if ( $skipped_len > 0 ) {
-        my $plain = $escaper->( substr( $$content, $pos, $skipped_len ) );
+        my $plain;
+        if ( $html ) {
+            $plain = substr( $$content, $pos, $skipped_len );
+        }
+        else {
+            $plain = $escaper->( substr( $$content, $pos, $skipped_len ) )
+        }
         substr( $$content, $pos, $skipped_len ) = $plain;
         $pos += length($plain);
     }
@@ -151,7 +159,8 @@
     pos($$content) = ( $pos += length($plain) );
 
 }
-substr( $$content, $pos ) = $escaper->( substr( $$content, $pos ) ) unless $pos == length $$content;
+substr( $$content, $pos ) = $escaper->( substr( $$content, $pos ) ) unless
+($pos == length $$content) || $html;
 
 pos($$content) = 0;
 

Modified: rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments
==============================================================================
--- rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments	(original)
+++ rt/3.8/trunk/share/html/Ticket/Elements/ShowTransactionAttachments	Fri Dec 12 19:11:40 2008
@@ -116,7 +116,12 @@
 
             # if it's a text/html clean the body and show it
             if ( $message->ContentType =~ m{^text/(?:html|enriched)$}i ) {
-                $m->out( $m->comp( '/Elements/ScrubHTML', Content => $content ) );
+                $content = $m->comp( '/Elements/ScrubHTML', Content => $content );
+                if ( $message->ContentType eq 'text/html' ) {
+                    $m->comp('/Elements/MakeClicky', 
+                            content => \$content, html => 1 );
+                }
+                $m->out( $content );
             }
 
             # if it's a text/plain show the body


More information about the Rt-commit mailing list