Fixed issue in log message sanitization in SQL Server Settings Storage Provider.
This commit is contained in:
parent
aab14b7941
commit
2366273754
2 changed files with 15 additions and 3 deletions
|
@ -228,6 +228,18 @@ namespace ScrewTurn.Wiki.Plugins.SqlCommon {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sanitizes a stiring from all unfriendly characters.
|
||||
/// </summary>
|
||||
/// <param name="input">The input string.</param>
|
||||
/// <returns>The sanitized result.</returns>
|
||||
private static string Sanitize(string input) {
|
||||
StringBuilder sb = new StringBuilder(input);
|
||||
sb.Replace("<", "<");
|
||||
sb.Replace(">", ">");
|
||||
return sb.ToString();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Records a message to the System Log.
|
||||
/// </summary>
|
||||
|
@ -253,8 +265,8 @@ namespace ScrewTurn.Wiki.Plugins.SqlCommon {
|
|||
List<Parameter> parameters = new List<Parameter>(4);
|
||||
parameters.Add(new Parameter(ParameterType.DateTime, "DateTime", DateTime.Now));
|
||||
parameters.Add(new Parameter(ParameterType.Char, "EntryType", EntryTypeToChar(entryType)));
|
||||
parameters.Add(new Parameter(ParameterType.String, "User", user));
|
||||
parameters.Add(new Parameter(ParameterType.String, "Message", message));
|
||||
parameters.Add(new Parameter(ParameterType.String, "User", Sanitize(user)));
|
||||
parameters.Add(new Parameter(ParameterType.String, "Message", Sanitize(message)));
|
||||
|
||||
try {
|
||||
DbCommand command = builder.GetCommand(connString, query, parameters);
|
||||
|
|
|
@ -13,7 +13,7 @@ namespace ScrewTurn.Wiki.Plugins.SqlServer {
|
|||
/// </summary>
|
||||
public class SqlServerSettingsStorageProvider : SqlSettingsStorageProviderBase {
|
||||
|
||||
private readonly ComponentInformation info = new ComponentInformation("SQL Server Settings Storage Provider", "ScrewTurn Software", "3.0.0.341", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Settings.txt");
|
||||
private readonly ComponentInformation info = new ComponentInformation("SQL Server Settings Storage Provider", "ScrewTurn Software", "3.0.0.441", "http://www.screwturn.eu", "http://www.screwturn.eu/Version/SQLServerProv/Settings.txt");
|
||||
|
||||
private readonly SqlServerCommandBuilder commandBuilder = new SqlServerCommandBuilder();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue