mirror of
https://github.com/tribufu/ServerManagers
synced 2026-06-01 09:42:39 +00:00
bugfix: empty quoted string are not written properly
This commit is contained in:
parent
6e3a6b9890
commit
64c55f3f32
1 changed files with 15 additions and 5 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
using ServerManagerTool.Common.Attibutes;
|
using ServerManagerTool.Common.Attibutes;
|
||||||
using ServerManagerTool.Common.Enums;
|
using ServerManagerTool.Common.Enums;
|
||||||
|
using ServerManagerTool.Common.Extensions;
|
||||||
using ServerManagerTool.Common.Interfaces;
|
using ServerManagerTool.Common.Interfaces;
|
||||||
using ServerManagerTool.Common.Utils;
|
using ServerManagerTool.Common.Utils;
|
||||||
using System;
|
using System;
|
||||||
|
|
@ -349,11 +350,20 @@ namespace ServerManagerTool.Common.Serialization
|
||||||
|
|
||||||
if (attr.QuotedString == QuotedStringType.True)
|
if (attr.QuotedString == QuotedStringType.True)
|
||||||
{
|
{
|
||||||
// add the leading and trailing quotes, if not already have them.
|
// if the stValue is empty, return empty quoted string (parsing not needed)
|
||||||
if (!strValue.StartsWith("\""))
|
// bug fix for 'property="' on a empty string
|
||||||
strValue = "\"" + strValue;
|
if (strValue.IsEmpty())
|
||||||
if (!strValue.EndsWith("\""))
|
{
|
||||||
strValue = strValue + "\"";
|
strValue = "\"\"";
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
// add the leading and trailing quotes, if not already have them.
|
||||||
|
if (!strValue.StartsWith("\""))
|
||||||
|
strValue = "\"" + strValue;
|
||||||
|
if (!strValue.EndsWith("\""))
|
||||||
|
strValue = strValue + "\"";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if (attr.QuotedString == QuotedStringType.Remove)
|
else if (attr.QuotedString == QuotedStringType.Remove)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue