Changeset 2417


Ignore:
Timestamp:
2001-05-15T12:20:00+12:00 (23 years ago)
Author:
sjboddie
Message:

fixed a bug in the way multi-value cgi arguments were being handled

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/src/recpt/cgiutils.cpp

    r1504 r2417  
    112112      // multiple checkboxes using the same name) we'll
    113113      // create a comma separated list of all the values
    114       // (if multiplevalue)
    115       if (!args[key].empty()) {
    116     const cgiarginfo *info = argsinfo.getarginfo (key);
    117     if (info != NULL && info->multiplevalue)
    118       args[key] += "," + value;
    119     else args.setarg (key, value, cgiarg_t::cgi_arg);
    120       } else
     114      // (we should probably use some kind of array here to
     115      // avoid problems when values already contain commas)
     116      const cgiarginfo *info = argsinfo.getarginfo (key);
     117      if (info != NULL && info->multiplevalue) {
     118    text_t newvalue = args[key];
     119    if (args.lookupcgiarg(key).source == cgiarg_t::cgi_arg) newvalue += ",";
     120    newvalue += value;
     121    args.setarg (key, newvalue, cgiarg_t::cgi_arg);
     122
     123      } else {
    121124    args.setarg (key, value, cgiarg_t::cgi_arg);
     125      }
    122126    }
    123127  }
Note: See TracChangeset for help on using the changeset viewer.