Changeset 13131


Ignore:
Timestamp:
2006-10-19T11:28:29+13:00 (18 years ago)
Author:
mdewsnip
Message:

Now uses the existing decode_commas function in cgiutils.

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

Legend:

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

    r12565 r13131  
    3333#include <sys/utsname.h>
    3434#include "gtiaction.h"
     35#include "cgiutils.h"
    3536#include "fileutil.h"
    3637#include "gsdlunicode.h"
     
    468469      submission_text += &cgi_argument_name_cstr[strlen(source_chunk_key_start_cstr)];
    469470      submission_text += "\">\n";
    470       submission_text += to_utf8(xml_safe(unescape_commas(args[cgi_argument->first]))) + "\n";
     471      submission_text += to_utf8(xml_safe(decode_commas(args[cgi_argument->first]))) + "\n";
    471472      submission_text += "</SourceFileText>\n";
    472473    }
     
    476477      submission_text += &cgi_argument_name_cstr[strlen(target_chunk_key_start_cstr)];
    477478      submission_text += "\">\n";
    478       submission_text += to_utf8(xml_safe(unescape_commas(args[cgi_argument->first]))) + "\n";
     479      submission_text += to_utf8(xml_safe(decode_commas(args[cgi_argument->first]))) + "\n";
    479480      submission_text += "</TargetFileText>\n";
    480481    }
     
    514515
    515516  return text_string_escaped;
    516 }
    517 
    518 
    519 
    520 text_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;
    537517}
    538518
  • trunk/gsdl/src/recpt/gtiaction.h

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