- Timestamp:
- 2016-02-10T14:53:51+13:00 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
main/trunk/greenstone2/runtime-src/src/recpt/cgiutils.cpp
r28888 r30373 412 412 text_t::const_iterator here = argstr.begin(); 413 413 text_t::const_iterator end = argstr.end(); 414 // get seems to be not unicode, while post is, so don't want to just assume encoding is 1 (not unicode) 415 unsigned short args_encoding = argstr.getencoding(); 416 cerr << "args enc = "<< args_encoding<<endl; 414 417 text_t key, value; 415 418 … … 425 428 safe_cgi_arg(key, value); // mitigate obvious cross-site scripting hacks in URL cgi-params 426 429 427 value.setencoding( 1);// other encoding430 value.setencoding(args_encoding); //1 // other encoding 428 431 // store this key=value pair 429 432 if (!key.empty()) { … … 441 444 // If the arg is not multi valued, then you need to decode the commas. 442 445 if (args.getarg(key)==NULL) { 443 args.setarg (key, encode_commas(value), cgiarg_t::cgi_arg); 446 // encode_commas returns a text_t without encoding bit set 447 text_t newvalue = encode_commas(value); 448 newvalue.setencoding(args_encoding); 449 args.setarg (key, newvalue, cgiarg_t::cgi_arg); 444 450 } 445 451 else { … … 447 453 448 454 newvalue += "," + encode_commas(value); 449 newvalue.setencoding( 1); // other encoding455 newvalue.setencoding(args_encoding); // other encoding 450 456 args.setarg (key, newvalue, cgiarg_t::cgi_arg); 451 457 } … … 457 463 if (args.lookupcgiarg(key).source == cgiarg_t::cgi_arg) newvalue += ","; 458 464 newvalue += encode_commas(value); 459 newvalue.setencoding( 1); // other encoding465 newvalue.setencoding(args_encoding); // other encoding 460 466 args.setarg (key, newvalue, cgiarg_t::cgi_arg); 461 467
Note:
See TracChangeset
for help on using the changeset viewer.