A bit more safety around control characters in strings.
This commit is contained in:
parent
83a02e18eb
commit
1ac6cbc4a6
|
@ -57,6 +57,8 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||||
{
|
{
|
||||||
if( c == '/' )
|
if( c == '/' )
|
||||||
converted += "{slash}";
|
converted += "{slash}";
|
||||||
|
else if( c == '\n' || c == '\r' )
|
||||||
|
converted += ""; // drop
|
||||||
else
|
else
|
||||||
converted += c;
|
converted += c;
|
||||||
}
|
}
|
||||||
|
@ -66,6 +68,8 @@ wxString EscapeString( const wxString& aSource, ESCAPE_CONTEXT aContext )
|
||||||
converted += "{brace}";
|
converted += "{brace}";
|
||||||
else if( c == ':' )
|
else if( c == ':' )
|
||||||
converted += "{colon}";
|
converted += "{colon}";
|
||||||
|
else if( c == '\n' || c == '\r' )
|
||||||
|
converted += ""; // drop
|
||||||
else
|
else
|
||||||
converted += c;
|
converted += c;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue