[Rt-commit] r15600 - in rt/branches/3.999-DANGEROUS: lib/RT lib/RT/Interface lib/RT/Model lib/RT/ScripAction

sunnavy at bestpractical.com sunnavy at bestpractical.com
Thu Aug 28 11:12:37 EDT 2008


Author: sunnavy
Date: Thu Aug 28 11:12:37 2008
New Revision: 15600

Modified:
   rt/branches/3.999-DANGEROUS/   (props changed)
   rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm
   rt/branches/3.999-DANGEROUS/lib/RT/Model/Template.pm
   rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm

Log:
 r16259 at sunnavys-mb:  sunnavy | 2008-08-28 21:55:11 +0800
 go on


Modified: rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/I18N.pm	Thu Aug 28 11:12:37 2008
@@ -167,7 +167,7 @@
     $charset = 'utf-8' if $charset =~ /^utf-?8$/i;
     $enc     = 'utf-8' if $enc     =~ /^utf-?8$/i;
 
-    set_mime_ehead_to_encoding(
+    set_mime_head_to_encoding(
         $entity->head,
         _find_or_guess_charset( $entity, 1 ) => $enc,
         $preserve_words
@@ -262,6 +262,7 @@
     my $enc = shift;
 
     @_ = $str =~ m/(.*?)=\?([^?]+)\?([QqBb])\?([^?]+)\?=([^=]*)/gcs;
+
     return ($str) unless (@_);
 
     # add everything that hasn't matched to the end of the latest
@@ -409,9 +410,9 @@
 
 # }}}
 
-# {{{ set_mime_ehead_to_encoding
+# {{{ set_mime_head_to_encoding
 
-=head2 set_mime_ehead_to_encoding HEAD OLD_CHARSET NEW_CHARSET
+=head2 set_mime_head_to_encoding HEAD OLD_CHARSET NEW_CHARSET
 
 Converts a MIME Head from one encoding to another. This totally violates the RFC.
 We should never need this. But, Surprise!, MUAs are badly broken and do this kind of stuff
@@ -420,7 +421,7 @@
 
 =cut
 
-sub set_mime_ehead_to_encoding {
+sub set_mime_head_to_encoding {
     my ( $head, $charset, $enc, $preserve_words ) = ( shift, shift, shift, shift );
 
     $charset = 'utf-8' if $charset eq 'utf8';

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Interface/Email.pm	Thu Aug 28 11:12:37 2008
@@ -1021,13 +1021,13 @@
     my $ticket  = shift;
     unless ( ref $ticket ) {
         my $tmp = RT::Model::Ticket->new( current_user => RT->system_user);
-        $tmp->Load($ticket);
+        $tmp->load($ticket->id);
         $ticket = $tmp;
     }
     my $id        = $ticket->id;
     my $queue_tag = $ticket->queue_obj->subject_tag;
 
-    my $tag_re = RT->config->get('EmailsubjectTagRegex');
+    my $tag_re = RT->config->get('EmailSubjectTagRegex');
     unless ($tag_re) {
         my $tag = $queue_tag || RT->config->get('rtname');
         $tag_re = qr/\Q$tag\E/;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/Model/Template.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/Model/Template.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/Model/Template.pm	Thu Aug 28 11:12:37 2008
@@ -331,7 +331,7 @@
     my $self = shift;
     my ( $rv, $msg );
 
-    if ( $self->content =~ m{^Content-type:\s+text/html\b}im ) {
+    if ( $self->content =~ m{^Content-Type:\s+text/html\b}im ) {
         local $RT::Model::Transaction::Preferredcontent_type = 'text/html';
         ( $rv, $msg ) = $self->_parse(@_);
     }
@@ -466,7 +466,6 @@
 sub _downgrade_from_html {
     my $self        = shift;
     my $orig_entity = $self->mime_obj;
-    die 'hehe';
 
     local $RT::Model::Transaction::Preferredcontent_type = 'text/plain';
 
@@ -476,13 +475,13 @@
         return;
     }
 
-    $orig_entity->head->mime_attr( "Content-type"         => 'text/html' );
-    $orig_entity->head->mime_attr( "Content-type.charset" => 'utf-8' );
+    $orig_entity->head->mime_attr( "Content-Type"         => 'text/html' );
+    $orig_entity->head->mime_attr( "Content-Type.charset" => 'utf-8' );
     $orig_entity->make_multipart( 'alternative', Force => 1 );
 
     my $new_entity = $self->{mime_obj};
-    $new_entity->head->mime_attr( "Content-type"         => 'text/plain' );
-    $new_entity->head->mime_attr( "Content-type.charset" => 'utf-8' );
+    $new_entity->head->mime_attr( "Content-Type"         => 'text/plain' );
+    $new_entity->head->mime_attr( "Content-Type.charset" => 'utf-8' );
 
     require HTML::formatText;
     require HTML::TreeBuilder;

Modified: rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm
==============================================================================
--- rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	(original)
+++ rt/branches/3.999-DANGEROUS/lib/RT/ScripAction/SendEmail.pm	Thu Aug 28 11:12:37 2008
@@ -205,8 +205,8 @@
     foreach my $part ( grep !$_->is_multipart, $mime_obj->parts_DFS ) {
         my $type = $part->mime_type || 'text/plain';
         $type = 'text/plain' unless RT::I18N::is_textual_content_type($type);
-        $part->head->mime_attr( "Content-type"         => $type );
-        $part->head->mime_attr( "Content-type.charset" => 'utf-8' );
+        $part->head->mime_attr( "Content-Type"         => $type );
+        $part->head->mime_attr( "Content-Type.charset" => 'utf-8' );
     }
 
     RT::I18N::set_mime_entity_to_encoding( $mime_obj, RT->config->get('EmailOutputEncoding'), 'mime_words_ok', );


More information about the Rt-commit mailing list