Changeset 14663 for trunk


Ignore:
Timestamp:
11/19/12 18:29:24 (12 years ago)
Author:
tbretz
Message:
Properly escape string arguments sent via dim.send
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/FACT++/src/InterpreterV8.cc

    r14655 r14663  
    220220    for (int i=1; i<args.Length(); i++)
    221221    {
    222         const String::AsciiValue arg(args[i]);
     222        string arg = *String::AsciiValue(args[i]);
     223
     224        // Escape string
    223225        if (args[i]->IsString())
    224             command += " \""+string(*arg)+"\"";
    225         else
    226             command += " "+string(*arg);
     226        {
     227            boost::replace_all(arg, "\\", "\\\\");
     228            boost::replace_all(arg, "'", "\\'");
     229            boost::replace_all(arg, "\"", "\\\"");
     230        }
     231
     232        command += " "+arg;
    227233    }
    228234
Note: See TracChangeset for help on using the changeset viewer.