Branch: Tag:

2009-03-31

2009-03-31 13:45:13 by Martin Stjernholm <mast@lysator.liu.se>

Don't try to decode variable values that got a mime type.

Rev: server/base_server/prototypes.pike:1.239

5:   #include <config.h>   #include <module.h>   #include <module_constants.h> - constant cvs_version="$Id: prototypes.pike,v 1.238 2009/03/30 12:01:57 mast Exp $"; + constant cvs_version="$Id: prototypes.pike,v 1.239 2009/03/31 13:45:13 mast Exp $";      #ifdef DAV_DEBUG   #define DAV_WERROR(X...) werror(X)
2463:    mapping(string:array(string)) decoded_vars = ([]);    if (mixed err = catch {    path = decoder (path); -  foreach (vars; string var; array(string) vals) +  foreach (vars; string var; array(string) vals) { +  if (vars[var + ".mimetype"]) +  // Don't decode the value if it has a mime type (which +  // we assume comes from a multipart/form-data POST). +  decoded_vars[decoder (var)] = vals; +  else    decoded_vars[decoder (var)] = map (vals, decoder); -  +  }    }) {   #ifdef DEBUG    if (decode_charset)
2498:    path = decoder (path);       mapping(string:array(string)) decoded_vars = ([]); -  foreach (vars; string var; array(string) vals) +  foreach (vars; string var; array(string) vals) { +  if (vars[var + ".mimetype"]) +  // Don't decode the value if it has a mime type (which we +  // assume comes from a multipart/form-data POST). +  decoded_vars[decoder (var)] = vals; +  else    decoded_vars[decoder (var)] = map (vals, decoder); -  +  }    vars = decoded_vars;    input_charset = decode_charset; // Set this after we're done.    }