Bug 12065: use encode_qp consistently when sending basket/shelf
[koha_fer] / basket / sendbasket.pl
index 885ee41..40547f0 100755 (executable)
@@ -122,6 +122,7 @@ if ( $email_add ) {
     if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) {
         $email_header = $1;
         $email_header =~ s|\n?(.*)\n?|$1|;
+        $email_header = encode_qp($email_header);
     }
 
     my $email_file = "basket.txt";
@@ -133,19 +134,12 @@ if ( $email_add ) {
     if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) {
         $body = $1;
         $body =~ s|\n?(.*)\n?|$1|;
-        $body = encode("UTF-8", encode_qp($body));
+        $body = encode_qp($body);
     }
 
     my $boundary = "====" . time() . "====";
 
-    #     $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
-    #
-    #     $email_header = encode_qp($email_header);
-    #
-    #     $boundary = "--".$boundary;
-    #
-    #     # Writing mail
-    #     $mail{body} =
+    # Writing mail
     $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
     my $isofile = encode_base64(encode("UTF-8", $iso2709));
     $boundary = '--' . $boundary;