Merge pull request #2677 from drunderscore/fix/escape-sqlite-table-names-with-string-interp

Use a string interpolation and escape single quotes when escaping tables
This commit is contained in:
Lucas Nicodemus 2022-10-05 22:12:16 -07:00 committed by GitHub
commit 44af5929ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View file

@ -22,6 +22,7 @@ This is the rolling changelog for TShock for Terraria. Use past tense when addin
* Added preliminary support for Terraria 1.4.4.4. (@SignatureBeef)
* GrassSpreadEventArgs Color property has been changed from a Byte to a TileColorCache type. (@SignatureBeef)
* SetDefaultsEventArgs now includes a nullable ItemVariant instance. (@SignatureBeef)
* Use a string interpolation and escape single quotes when escaping tables (@drunderscore)
## TShock 4.5.18
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@gohjoseph)

View file

@ -172,7 +172,7 @@ namespace TShockAPI.DB
/// <returns></returns>
protected override string EscapeTableName(string table)
{
return table.SFormat("'{0}'", table);
return $"\'{table}\'";
}
}