[Rt-commit] r9768 - in rt/branches/3.6-RELEASE: . lib/RT/Interface

jesse at bestpractical.com jesse at bestpractical.com
Fri Nov 30 14:14:26 EST 2007


Author: jesse
Date: Fri Nov 30 14:14:25 2007
New Revision: 9768

Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/lib/RT/I18N.pm
   rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm

Log:
 r72537 at pinglin:  jesse | 2007-11-30 14:13:55 -0500
 * Applied http://page.mi.fu-berlin.de/pape/rt3/patches/rt/3.6.5/less_warnings_in_error_log.patch from Dirk Pape to quiet some warnings


Modified: rt/branches/3.6-RELEASE/lib/RT/I18N.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/I18N.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/I18N.pm	Fri Nov 30 14:14:25 2007
@@ -411,6 +411,7 @@
 	Encode::Guess->set_suspects(@RT::EmailInputEncodings);
 	my $decoder = Encode::Guess->guess( $_[0] );
 
+      if ( defined($decoder) ) {
 	if ( ref $decoder ) {
 	    $charset = $decoder->name;
 	    $RT::Logger->debug("Guessed encoding: $charset");
@@ -430,6 +431,10 @@
 	else {
 	    $RT::Logger->warning("Encode::Guess failed: $decoder; fallback to $fallback");
 	}
+      }
+      else {
+	  $RT::Logger->warning("Encode::Guess failed: decoder is undefined; fallback to $fallback");
+      }
     }
     else {
 	$RT::Logger->warning("Cannot Encode::Guess; fallback to $fallback");

Modified: rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/Interface/Web.pm	Fri Nov 30 14:14:25 2007
@@ -639,7 +639,7 @@
 
     #Make the update content have no 'weird' newlines in it
 
-    $args{'Body'} =~ s/\r\n/\n/gs;
+    $args{'Body'} =~ s/\r\n/\n/gs if $args{'Body'};
     my $Message;
     {
         # MIME::Head is not happy in utf-8 domain.  This only happens
@@ -1286,7 +1286,7 @@
             @values = @{ $args{'ARGS'}->{$arg} };
         } elsif ( $cf_type =~ /text/i ) { # Both Text and Wikitext
             @values = ($args{'ARGS'}->{$arg});
-        } else {
+        } elsif ( defined( $args{'ARGS'}->{ $arg } ) ) {
             @values = split /\n/, $args{'ARGS'}->{ $arg };
         }
         
@@ -1512,7 +1512,7 @@
         my $DateObj = RT::Date->new( $session{'CurrentUser'} );
 
         #If it's something other than just whitespace
-        if ( $ARGSRef->{ $field . '_Date' } ne '' ) {
+        if ( $ARGSRef->{ $field . '_Date' } && ($ARGSRef->{ $field . '_Date' } ne '') ) {
             $DateObj->Set(
                 Format => 'unknown',
                 Value  => $ARGSRef->{ $field . '_Date' }


More information about the Rt-commit mailing list