From 4ee660a2de3de36c3bc5298edd098a56defc1d81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Demians?= Date: Tue, 24 Sep 2013 18:48:30 +0200 Subject: [PATCH] Bug 10605 Problems with translated cart email sent from OPAC THis patch suppress a double-encoding. --- opac/opac-sendbasket.pl | 22 ++++++---------------- 1 files changed, 6 insertions(+), 16 deletions(-) diff --git a/opac/opac-sendbasket.pl b/opac/opac-sendbasket.pl index da74745..bba301a 100755 --- a/opac/opac-sendbasket.pl +++ b/opac/opac-sendbasket.pl @@ -124,27 +124,17 @@ if ( $email_add ) { # Getting template result my $template_res = $template2->output(); - my $body; # Analysing information and getting mail properties - if ( $template_res =~ /\n(.*)\n?/s ) { - $mail{'subject'} = $1; - } - else { $mail{'subject'} = "no subject"; } + $mail{subject} = $template_res =~ /\n(.*)\n?/s + ? $1 : "no subject"; - my $email_header = ""; - if ( $template_res =~ /
\n(.*)\n?/s ) { - $email_header = encode_qp($1); - } + my ($email_header) = $template_res =~ /
\n(.*)\n?/s; - my $email_file = "basket.txt"; - if ( $template_res =~ /\n(.*)\n?/s ) { - $email_file = $1; - } + my $email_file = $template_res =~ /\n(.*)\n?/s + ? $1 : "basket.txt"; - if ( $template_res =~ /\n(.*)\n?/s ) { - $body = encode_qp($1); - } + my ($body) = $template_res =~ /\n(.*)\n?/s; my $boundary = "====" . time() . "===="; -- 1.7.2.5