Changeset 12565


Ignore:
Timestamp:
2006-08-25T14:44:12+12:00 (18 years ago)
Author:
mdewsnip
Message:

A fix to compensate for the change to the way commas in CGI values are dealt with by default.

Location:
trunk/gsdl/src/recpt
Files:
2 edited

Legend:

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

    r12485 r12565  
    468468      submission_text += &cgi_argument_name_cstr[strlen(source_chunk_key_start_cstr)];
    469469      submission_text += "\">\n";
    470       submission_text += to_utf8(xml_safe(args[cgi_argument->first])) + "\n";
     470      submission_text += to_utf8(xml_safe(unescape_commas(args[cgi_argument->first]))) + "\n";
    471471      submission_text += "</SourceFileText>\n";
    472472    }
     
    476476      submission_text += &cgi_argument_name_cstr[strlen(target_chunk_key_start_cstr)];
    477477      submission_text += "\">\n";
    478       submission_text += to_utf8(xml_safe(args[cgi_argument->first])) + "\n";
     478      submission_text += to_utf8(xml_safe(unescape_commas(args[cgi_argument->first]))) + "\n";
    479479      submission_text += "</TargetFileText>\n";
    480480    }
     
    514514
    515515  return text_string_escaped;
     516}
     517
     518
     519
     520text_t gtiaction::unescape_commas(text_t text_string)
     521{
     522  text_t text_string_commas_unescaped = "";
     523
     524  text_t::iterator text_string_character = text_string.begin();
     525  while (text_string_character != text_string.end()) {
     526    if (*text_string_character == '%' && (text_string_character+1) != text_string.end() && *(text_string_character+1) == '2' && (text_string_character+2) != text_string.end() && *(text_string_character+2) == 'C') {
     527      text_string_commas_unescaped += ",";
     528      text_string_character += 2;
     529    }
     530    else {
     531      text_string_commas_unescaped.push_back(*text_string_character);
     532    }
     533    text_string_character++;
     534  }
     535
     536  return text_string_commas_unescaped;
    516537}
    517538
  • trunk/gsdl/src/recpt/gtiaction.h

    r11460 r12565  
    107107  text_t escape_all(text_t source_string, char character_to_escape);
    108108
     109  text_t unescape_commas(text_t source_string);
     110
    109111  text_t xml_safe(const text_t &text_string);
    110112
Note: See TracChangeset for help on using the changeset viewer.