Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 974b5d86

Von Moritz Bunkus vor mehr als 17 Jahren hinzugefügt

  • ID 974b5d8664caba8cebfccc55b1be53a09916a200
  • Vorgänger ebacee0a
  • Nachfolger d5b09512

Filehandles lokal deklarieren. Kosmetik. In Mailer.pm open() nur mit festgelegtem Argument aufrufen.

Unterschiede anzeigen:

SL/Form.pm
731 731
  $main::lxdebug->enter_sub();
732 732

  
733 733
  my ($self, $myconfig, $userspath) = @_;
734
  my $template;
734
  my ($template, $out);
735

  
736
  local (*IN, *OUT);
735 737

  
736 738
  $self->{"cwd"} = getcwd();
737 739
  $self->{"tmpdir"} = $self->{cwd} . "/${userspath}";
......
775 777
  # for postscript we store a copy in a temporary file
776 778
  my $fileid = time;
777 779
  $self->{tmpfile} ||= "$userspath/${fileid}.$self->{IN}";
780

  
778 781
  if ($template->uses_temp_file() || $self->{media} eq 'email') {
779 782
    $out = $self->{OUT};
780 783
    $self->{OUT} = ">$self->{tmpfile}";
......
841 844

  
842 845
      }
843 846

  
844
      my $err = $mail->send($out);
847
      my $err = $mail->send();
845 848
      $self->error($self->cleanup . "$err") if ($err);
846 849

  
847 850
    } else {
SL/Mailer.pm
89 89
sub send {
90 90
  $main::lxdebug->enter_sub();
91 91

  
92
  my ($self, $out) = @_;
92
  my ($self) = @_;
93

  
94
  local (*IN, *OUT);
93 95

  
94 96
  my $boundary = time;
95 97
  $boundary = "LxOffice-$self->{version}-$boundary";
......
99 101

  
100 102
  $self->{charset} = Common::DEFAULT_CHARSET unless $self->{charset};
101 103

  
102
  if ($out) {
103
    if (!open(OUT, $out)) {
104
      $main::lxdebug->leave_sub();
105
      return "$out : $!";
106
    }
107
  } else {
108
    if (!open(OUT, ">-")) {
109
      $main::lxdebug->leave_sub();
110
      return "STDOUT : $!";
111
    }
104
  if (!open(OUT, $main::sendmail)) {
105
    $main::lxdebug->leave_sub();
106
    return "$main::sendmail : $!";
112 107
  }
113 108

  
114 109
  $self->{contenttype} = "text/plain" unless $self->{contenttype};
bin/mozilla/io.pl
1748 1748
    $form->{subject} = qq|$form->{label} $form->{"${inv}number"}|
1749 1749
      unless $form->{subject};
1750 1750

  
1751
    $form->{OUT} = "$sendmail";
1752

  
1753 1751
    $form->{emailed} .= " $form->{formname}";
1754 1752
    $form->{emailed} =~ s/^ //;
1755 1753
  }

Auch abrufbar als: Unified diff