Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision 1e0d4130

Von Moritz Bunkus vor mehr als 13 Jahren hinzugefügt

  • ID 1e0d413084100ccd892e8c5be95703be5d965de7
  • Vorgänger 7b129753
  • Nachfolger 0c32dd23

Hochgeladene Dateien nicht mittels _recode_recursively umcodieren

Unterschiede anzeigen:

SL/Form.pm
133 133

  
134 134
  my $self  = shift;
135 135
  my $input = shift;
136
  my $uploads = {};
136 137

  
137 138
  if (!$ENV{'CONTENT_TYPE'}
138 139
      || ($ENV{'CONTENT_TYPE'} !~ /multipart\/form-data\s*;\s*boundary\s*=\s*(.+)$/)) {
......
140 141
    $self->_input_to_hash($input);
141 142

  
142 143
    $main::lxdebug->leave_sub(2);
143
    return;
144
    return $uploads;
144 145
  }
145 146

  
146 147
  my ($name, $filename, $headers_done, $content_type, $boundary_found, $need_cr, $previous);
......
185 186
          substr $line, $-[0], $+[0] - $-[0], "";
186 187
        }
187 188

  
188
        $previous         = $self->_store_value($name, '') if ($name);
189
        $previous         = _store_value($uploads, $name, '') if ($name);
189 190
        $self->{FILENAME} = $filename if ($filename);
190 191

  
191 192
        next;
......
206 207
  ${ $previous } =~ s|\r?\n$|| if $previous;
207 208

  
208 209
  $main::lxdebug->leave_sub(2);
210

  
211
  return $uploads;
209 212
}
210 213

  
211 214
sub _recode_recursively {
......
256 259
  $self->_input_to_hash($ENV{QUERY_STRING}) if $ENV{QUERY_STRING};
257 260
  $self->_input_to_hash($ARGV[0])           if @ARGV && $ARGV[0];
258 261

  
262
  my $uploads;
259 263
  if ($ENV{CONTENT_LENGTH}) {
260 264
    my $content;
261 265
    read STDIN, $content, $ENV{CONTENT_LENGTH};
262
    $self->_request_to_hash($content);
266
    $uploads = $self->_request_to_hash($content);
263 267
  }
264 268

  
265 269
  my $db_charset   = $::lx_office_conf{system}->{dbcharset};
......
270 274

  
271 275
  _recode_recursively(SL::Iconv->new($encoding, $db_charset), $self);
272 276

  
277
  map { $self->{$_} = $uploads->{$_} } keys %{ $uploads } if $uploads;
278

  
273 279
  #$self->{version} =  "2.6.1";                 # Old hardcoded but secure style
274 280
  open VERSION_FILE, "VERSION";                 # New but flexible code reads version from VERSION-file
275 281
  $self->{version} =  <VERSION_FILE>;

Auch abrufbar als: Unified diff