File tree Expand file tree Collapse file tree 6 files changed +8
-15
lines changed Expand file tree Collapse file tree 6 files changed +8
-15
lines changed Original file line number Diff line number Diff line change 11package main
22
33import (
4- "html"
54 "log"
65 "regexp"
76 "strings"
@@ -323,7 +322,7 @@ func TibiaCharactersCharacterV3(c *gin.Context) {
323322 if len (subma1a ) > 0 {
324323
325324 // fixing encoding for achievement name
326- subma1a [0 ][2 ] = html . UnescapeString (subma1a [0 ][2 ])
325+ subma1a [0 ][2 ] = TibiaDataSanitizeEscapedString (subma1a [0 ][2 ])
327326
328327 // get the name of the achievement (and ignore the secret image on the right)
329328 Name := strings .Split (subma1a [0 ][2 ], "<img" )
Original file line number Diff line number Diff line change 11package main
22
33import (
4- "html"
54 "log"
65 "regexp"
76 "strings"
@@ -148,7 +147,7 @@ func TibiaFansitesV3(c *gin.Context) {
148147 }
149148
150149 // Specials
151- subma1 [0 ][8 ] = html . UnescapeString (subma1 [0 ][8 ])
150+ subma1 [0 ][8 ] = TibiaDataSanitizeEscapedString (subma1 [0 ][8 ])
152151 FansiteSpecialsData := strings .Split (subma1 [0 ][8 ], "</li><li>" )
153152
154153 // FansiteItem & FansiteItemURL
Original file line number Diff line number Diff line change @@ -120,7 +120,7 @@ func TibiaGuildsGuildV3(c *gin.Context) {
120120
121121 // Abort loop and continue wiht next section
122122 if strings .Contains (line , "<br/><br/>" ) {
123- GuildDescription = TibiadataUnescapeStringV3 (GuildDescription )
123+ GuildDescription = TibiaDataSanitizeEscapedString (GuildDescription )
124124 GuildDescriptionFinished = true
125125 }
126126
@@ -160,7 +160,7 @@ func TibiaGuildsGuildV3(c *gin.Context) {
160160 subma1b := regex1b .FindAllStringSubmatch (line , - 1 )
161161
162162 GuildGuildhallData = append (GuildGuildhallData , Guildhall {
163- Name : TibiadataUnescapeStringV3 (subma1b [0 ][1 ]),
163+ Name : TibiaDataSanitizeEscapedString (subma1b [0 ][1 ]),
164164 World : GuildWorld ,
165165 PaidUntil : TibiadataDateV3 (subma1b [0 ][2 ]),
166166 })
@@ -213,7 +213,7 @@ func TibiaGuildsGuildV3(c *gin.Context) {
213213 }
214214
215215 MembersData = append (MembersData , Members {
216- Name : TibiadataUnescapeStringV3 (subma1 [0 ][2 ]),
216+ Name : TibiaDataSanitizeEscapedString (subma1 [0 ][2 ]),
217217 Title : MembersTitle ,
218218 Rank : MembersRank ,
219219 Vocation : subma1 [0 ][4 ],
Original file line number Diff line number Diff line change @@ -76,9 +76,9 @@ func TibiaGuildsOverviewV3(c *gin.Context) {
7676
7777 if len (subma1 ) > 0 {
7878 OneGuild := Guild {
79- Name : TibiadataUnescapeStringV3 (subma1 [0 ][2 ]),
79+ Name : TibiaDataSanitizeEscapedString (subma1 [0 ][2 ]),
8080 LogoURL : subma1 [0 ][1 ],
81- Description : TibiadataUnescapeStringV3 (strings .TrimSpace (subma1 [0 ][4 ])),
81+ Description : TibiaDataSanitizeEscapedString (strings .TrimSpace (subma1 [0 ][4 ])),
8282 }
8383
8484 // Adding OneWorld to correct category
Original file line number Diff line number Diff line change @@ -122,7 +122,7 @@ func TibiaSpellsOverviewV3(c *gin.Context) {
122122 SpellsData = append (SpellsData , Spell {
123123 Name : subma1 [0 ][2 ],
124124 Spell : subma1 [0 ][1 ],
125- Formula : TibiaDataSanitizeDoubleQuoteString (TibiadataUnescapeStringV3 (subma1 [0 ][3 ])),
125+ Formula : TibiaDataSanitizeDoubleQuoteString (TibiaDataSanitizeEscapedString (subma1 [0 ][3 ])),
126126 Level : TibiadataStringToIntegerV3 (subma1 [0 ][6 ]),
127127 Mana : TibiadataStringToIntegerV3 (subma1 [0 ][7 ]),
128128 Price : TibiadataStringToIntegerV3 (subma1 [0 ][8 ]),
Original file line number Diff line number Diff line change @@ -333,11 +333,6 @@ func TibiadataStringWorldFormatToTitleV3(world string) string {
333333 return strings .Title (strings .ToLower (world ))
334334}
335335
336- // TibiadataUnescapeStringV3 func
337- func TibiadataUnescapeStringV3 (data string ) string {
338- return html .UnescapeString (data )
339- }
340-
341336// TibiadataQueryEscapeStringV3 func - encode string to be correct formatted
342337func TibiadataQueryEscapeStringV3 (data string ) string {
343338 // switching "+" to " "
You can’t perform that action at this time.
0 commit comments