From 8dd5db64a169bd57f2fa07fa426428f4d2b84bc5 Mon Sep 17 00:00:00 2001 From: ZeqMacaw Date: Wed, 16 Oct 2019 17:40:42 -0400 Subject: [PATCH] FIXED: Fails to publish item that has double-quotes in Title and a content folder for Garry's Mod. --- .../Core/SteamAppInfos/GarrysModSteamAppInfo.vb | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb b/Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb index b24c9ee..921d1e1 100644 --- a/Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb +++ b/Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb @@ -1,5 +1,6 @@ Imports System.ComponentModel Imports System.IO +Imports System.Web.Script.Serialization Imports Steamworks Public Class GarrysModSteamAppInfo @@ -199,22 +200,23 @@ Public Class GarrysModSteamAppInfo fileStream = File.CreateText(addonJsonPathFileName) fileStream.AutoFlush = True Try + Dim jss As JavaScriptSerializer = New JavaScriptSerializer() If File.Exists(addonJsonPathFileName) Then fileStream.WriteLine("{") - fileStream.WriteLine(vbTab + """title"": """ + itemTitle + """,") + fileStream.WriteLine(vbTab + """title"": " + jss.Serialize(itemTitle) + ",") If itemTags.Count > 1 Then - fileStream.WriteLine(vbTab + """type"": """ + itemTags(0) + """,") + fileStream.WriteLine(vbTab + """type"": " + jss.Serialize(itemTags(0)) + ",") fileStream.WriteLine(vbTab + """tags"": ") fileStream.WriteLine(vbTab + "[") If itemTags.Count > 2 Then - fileStream.WriteLine(vbTab + vbTab + """" + itemTags(1) + """,") - fileStream.WriteLine(vbTab + vbTab + """" + itemTags(2) + """") + fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(1)) + ",") + fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(2))) Else - fileStream.WriteLine(vbTab + vbTab + """" + itemTags(1) + """") + fileStream.WriteLine(vbTab + vbTab + jss.Serialize(itemTags(1))) End If fileStream.WriteLine(vbTab + "]") Else - fileStream.WriteLine(vbTab + """type"": """ + itemTags(0) + """") + fileStream.WriteLine(vbTab + """type"": " + jss.Serialize(itemTags(0))) End If fileStream.WriteLine("}") fileStream.Flush()