Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 14de4f7c

Von Moritz Bunkus vor mehr als 11 Jahren hinzugefügt

  • ID 14de4f7cc44ebf65b4e68c95c3638c3e9d94df7c
  • Vorgänger 46e31af5
  • Nachfolger b6df37fb

Form::parse_template: "Content-disposition: attachment"-Header nur ausgeben, wenn Attachmentname bekannt

Fixt #2351.

Unterschiede anzeigen:

SL/Form.pm
1156 1156
        seek  IN, 0, 0;
1157 1157

  
1158 1158
      } else {
1159
        $self->{attachment_filename} = ($self->{attachment_filename})
1160
                                     ? $self->{attachment_filename}
1161
                                     : $self->generate_attachment_filename();
1162

  
1163
        # launch application
1164
        print qq|Content-Type: | . $template->get_mime_type() . qq|
1165
Content-Disposition: attachment; filename="$self->{attachment_filename}"
1166
Content-Length: $numbytes
1159
        my %headers = ('-type'       => $template->get_mime_type,
1160
                       '-connection' => 'close',
1161
                       '-charset'    => 'UTF-8');
1162

  
1163
        $self->{attachment_filename} ||= $self->generate_attachment_filename;
1164

  
1165
        if ($self->{attachment_filename}) {
1166
          %headers = (
1167
            %headers,
1168
            '-attachment'     => $self->{attachment_filename},
1169
            '-content-length' => $numbytes,
1170
            '-charset'        => '',
1171
          );
1172
        }
1167 1173

  
1168
|;
1174
        print $::request->cgi->header(%headers);
1169 1175

  
1170 1176
        $::locale->with_raw_io(\*STDOUT, sub { print while <IN> });
1171 1177
      }

Auch abrufbar als: Unified diff