Skip to content

Commit

Permalink
FIXED: Fails to publish item that has double-quotes in Title and a co…
Browse files Browse the repository at this point in the history
…ntent folder for Garry's Mod.
  • Loading branch information
ZeqMacaw committed Oct 16, 2019
1 parent 88682a2 commit 8dd5db6
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Crowbar/Core/SteamAppInfos/GarrysModSteamAppInfo.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
Imports System.ComponentModel
Imports System.IO
Imports System.Web.Script.Serialization
Imports Steamworks

Public Class GarrysModSteamAppInfo
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 8dd5db6

Please sign in to comment.