Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Projets publics
Sympa
Commits
708421a5
Commit
708421a5
authored
Dec 14, 2018
by
IKEDA Soji
Browse files
Additional changes for PR#494:
Avoid two-args open and bareword filehandle. Ignore errors.
parent
7e94cbaf
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/Sympa/Message.pm
View file @
708421a5
...
...
@@ -1719,21 +1719,24 @@ sub _decorate_parts {
## append footer/header
my ($glo
bal_footer_text
,
$footer_text
,
$header_text
)
=
('',
'',
'');
if
(
$header
and
-
s $header) {
open HEADER, $header;
$
header_text
=
join
'',
<
HEADER
>
;
close
HEADER
;
if (open my $fh, '<', $
header
)
{
$header_text
=
do
{
local
$RS
;
<
$fh
>
};
close
$fh
;
}
$header_text
=
''
unless
$header_text
=~
/\S/
;
}
if
(
$footer
and
-
s $footer) {
open FOOTER, $footer;
$
footer_text
=
join
'',
<
FOOTER
>
;
close
FOOTER
;
if (open my $fh, '<', $
footer
)
{
$footer_text
=
do
{
local
$RS
;
<
$fh
>
};
close
$fh
;
}
$footer_text
=
''
unless
$footer_text
=~
/\S/
;
}
if
(
$global_footer
and
-
s $global_footer) {
open FOOTER, $global_footer;
$glo
bal_footer_text
=
join
'',
<
FOOTER
>
;
close
FOOTER
;
if (open my $fh, '<', $glo
bal_footer
)
{
$global_footer_text
=
do
{
local
$RS
;
<
$fh
>
};
close
$fh
;
}
$global_footer_text
=
''
unless
$global_footer_text
=~
/\S/
;
}
if
(
length
$header_text
...
...
@@ -1762,9 +1765,10 @@ sub _decorate_parts {
}
if
(
$header
and
-
s $header) {
open my $fh, '<', $
header
;
if
(
$header
=~
/\.mime$/
)
{
my $fh;
unless (open $
fh
,
'
<
',
$header
)
{
;
}
elsif
(
$header
=~
/\.mime$/
)
{
my
$header_part
;
eval
{
$header_part
=
$parser
->
parse
(
$fh
);
};
close
$fh
;
...
...
@@ -1793,9 +1797,10 @@ sub _decorate_parts {
}
}
if
(
$footer
and
-
s $footer) {
open my $fh, '<', $
footer
;
if
(
$footer
=~
/\.mime$/
)
{
my $fh;
unless (open $
fh
,
'
<
',
$footer
)
{
;
}
elsif
(
$footer
=~
/\.mime$/
)
{
my
$footer_part
;
eval
{
$footer_part
=
$parser
->
parse
(
$fh
);
};
close
$fh
;
...
...
@@ -1822,9 +1827,10 @@ sub _decorate_parts {
}
}
if
(
$global_footer
and
-
s $global_footer) {
open my $fh, '<', $glo
bal_footer
;
if
(
$global_footer
=~
/\.mime$/
)
{
my $fh;
unless (open $
fh
,
'
<
',
$global_footer
)
{
;
}
elsif
(
$global_footer
=~
/\.mime$/
)
{
my
$global_footer_part
;
eval
{
$global_footer_part
=
$parser
->
parse
(
$fh
);
};
close
$fh
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment