projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
don't leave quotation side effects around, eek, RT#79310, RT#32489
[freeside.git]
/
FS
/
FS
/
Misc.pm
diff --git
a/FS/FS/Misc.pm
b/FS/FS/Misc.pm
index
a2d1b3e
..
669c44e
100644
(file)
--- a/
FS/FS/Misc.pm
+++ b/
FS/FS/Misc.pm
@@
-157,7
+157,10
@@
sub send_email {
unshift @mimeparts, {
'Type' => ( $options{'content-type'} || 'text/plain' ),
'Charset' => 'UTF-8',
unshift @mimeparts, {
'Type' => ( $options{'content-type'} || 'text/plain' ),
'Charset' => 'UTF-8',
- 'Data' => $options{'body'},
+ 'Data' => ( $options{'content-type'} =~ /^text\//
+ ? Encode::encode_utf8( $options{'body'} )
+ : $options{'body'}
+ ),
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
'Disposition' => 'inline',
};
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
'Disposition' => 'inline',
};
@@
-166,7
+169,10
@@
sub send_email {
@mimeargs = (
'Type' => ( $options{'content-type'} || 'text/plain' ),
@mimeargs = (
'Type' => ( $options{'content-type'} || 'text/plain' ),
- 'Data' => $options{'body'},
+ 'Data' => ( $options{'content-type'} =~ /^text\//
+ ? Encode::encode_utf8( $options{'body'} )
+ : $options{'body'}
+ ),
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
'Charset' => 'UTF-8',
);
'Encoding' => ( $options{'content-type'} ? '-SUGGEST' : '7bit' ),
'Charset' => 'UTF-8',
);
@@
-377,7
+383,7
@@
sub generate_email {
'Encoding' => 'quoted-printable',
'Charset' => 'UTF-8',
#'Encoding' => '7bit',
'Encoding' => 'quoted-printable',
'Charset' => 'UTF-8',
#'Encoding' => '7bit',
- 'Data' =>
$data
,
+ 'Data' =>
Encode::encode_utf8($data)
,
'Disposition' => 'inline',
);
'Disposition' => 'inline',
);
@@
-398,7
+404,7
@@
sub generate_email {
' </title>',
' </head>',
' <body bgcolor="#ffffff">',
' </title>',
' </head>',
' <body bgcolor="#ffffff">',
-
@html_data
,
+
( map Encode::encode_utf8($_), @html_data )
,
' </body>',
'</html>',
],
' </body>',
'</html>',
],
@@
-726,6
+732,8
@@
sub generate_ps {
my $papersize = $conf->config('papersize') || 'letter';
my $papersize = $conf->config('papersize') || 'letter';
+ local($SIG{CHLD}) = sub {};
+
system('dvips', '-q', '-t', $papersize, "$file.dvi", '-o', "$file.ps" ) == 0
or die "dvips failed";
system('dvips', '-q', '-t', $papersize, "$file.dvi", '-o', "$file.ps" ) == 0
or die "dvips failed";
@@
-783,6
+791,8
@@
sub generate_pdf {
#system('dvipdf', "$file.dvi", "$file.pdf" );
my $papersize = $conf->config('papersize') || 'letter';
#system('dvipdf', "$file.dvi", "$file.pdf" );
my $papersize = $conf->config('papersize') || 'letter';
+ local($SIG{CHLD}) = sub {};
+
system(
"dvips -q -f $sfile.dvi -t $papersize ".
"| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$sfile.pdf ".
system(
"dvips -q -f $sfile.dvi -t $papersize ".
"| gs -q -dNOPAUSE -dBATCH -sDEVICE=pdfwrite -sOutputFile=$sfile.pdf ".
@@
-865,6
+875,7
@@
sub do_print {
: $conf->config('lpr', $opt{'agentnum'} );
my $outerr = '';
: $conf->config('lpr', $opt{'agentnum'} );
my $outerr = '';
+ local($SIG{CHLD}) = sub {};
run3 $lpr, $data, \$outerr, \$outerr;
if ( $? ) {
$outerr = ": $outerr" if length($outerr);
run3 $lpr, $data, \$outerr, \$outerr;
if ( $? ) {
$outerr = ": $outerr" if length($outerr);
@@
-954,6
+965,8
@@
sub ocr_image {
print $fh $logo_data;
close $fh;
print $fh $logo_data;
close $fh;
+ local($SIG{CHLD}) = sub {};
+
run( [qw(ocroscript recognize), $filename], '>'=>"$filename.hocr" )
or die "ocroscript recognize failed\n";
run( [qw(ocroscript recognize), $filename], '>'=>"$filename.hocr" )
or die "ocroscript recognize failed\n";