-
-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Proper quoting of strings in trace config (#1149).
- Loading branch information
1 parent
7b08f61
commit 87933e5
Showing
1 changed file
with
7 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,11 +15,7 @@ | |
|
||
//$Authors = Jiri Cincura ([email protected]) | ||
|
||
using System; | ||
using System.Collections.Generic; | ||
using System.Globalization; | ||
using System.Linq; | ||
using System.Text; | ||
|
||
namespace FirebirdSql.Data.Services; | ||
|
||
|
@@ -32,7 +28,12 @@ protected static string WriteBoolValue(bool b) | |
|
||
protected static string WriteString(string s) | ||
{ | ||
return string.Format("'{0}'", s); | ||
s = s | ||
.Replace("{", "{{") | ||
.Replace("}", "}}") | ||
.Replace(@"\", @"\\") | ||
.Replace("\"", "\\\""); | ||
return string.Format("\"{0}\"", s); | ||
} | ||
|
||
protected static string WriteNumber(int i) | ||
|
@@ -42,6 +43,6 @@ protected static string WriteNumber(int i) | |
|
||
protected static string WriteRegEx(string re) | ||
{ | ||
return WriteString(re.Replace(@"\", @"\\").Replace("'", @"\'")); | ||
return WriteString(re); | ||
} | ||
} |