[Rt-commit] r9626 - rt/branches/3.6-RELEASE/lib/RT

audreyt at bestpractical.com audreyt at bestpractical.com
Fri Nov 9 15:06:10 EST 2007


Author: audreyt
Date: Fri Nov  9 15:06:09 2007
New Revision: 9626

Modified:
   rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm

Log:
* RT::Transaction_Overlay: Signatures in text/html content objects should be
  removed in a way that doesn't depend on whitespace.
  Also, remove an unneccessary regex capture.


Modified: rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/Transaction_Overlay.pm	Fri Nov  9 15:06:09 2007
@@ -293,9 +293,13 @@
         $content = $content_obj->Content;
 
 	if ($content_obj->ContentType =~ m{^text/html$}i) {
-        $content = HTML::FormatText->new(leftmargin => 0, rightmargin => 78)->format(  HTML::TreeBuilder->new_from_content( $content));
+            $content =~ s/<p>--\s+<br \/>.*?$//s if $args{'Quote'};
+            $content = HTML::FormatText->new(leftmargin => 0, rightmargin => 78)->format(  HTML::TreeBuilder->new_from_content( $content));
 
 	}
+        else {
+            $content =~ s/\n-- \n.*?$//s if $args{'Quote'};
+        }
     }
 
     # If all else fails, return a message that we couldn't find any content
@@ -305,9 +309,6 @@
 
     if ( $args{'Quote'} ) {
 
-        # Remove quoted signature.
-        $content =~ s/\n-- \n(.*?)$//s;
-
         # What's the longest line like?
         my $max = 0;
         foreach ( split ( /\n/, $content ) ) {


More information about the Rt-commit mailing list