Skip to content

fix: use Database.Format for SQL escaping instead of SQL_EscapeString - #62

Merged
Rushaway merged 1 commit into
masterfrom
fix/sql-format-escaping
Aug 27, 2026
Merged

fix: use Database.Format for SQL escaping instead of SQL_EscapeString#62
Rushaway merged 1 commit into
masterfrom
fix/sql-format-escaping

Conversation

@Rushaway

@Rushaway Rushaway commented Aug 24, 2026

Copy link
Copy Markdown
Member

Summary

  • Replace manual SQL_EscapeString + separate escaped buffers with g_hDatabase.Format, which escapes %s string arguments directly against the query.
  • Retype g_hDatabase from Handle to Database (it was already only ever used as a database handle) so the .Format methodmap call is available.
  • Bump version (3.2.9 -> 3.2.10).

Why

Database.Format is cleaner than a manual escape-then-format call per parameter and avoids extra driver/threading touchpoints from calling the escape function directly.

Test plan

  • Compile plugin and confirm no errors
  • Spray-ban a player with a name/reason containing quotes and confirm the query still succeeds
  • Hash-ban a spray with a target name containing quotes and confirm the query still succeeds

Copilot AI lite review requested due to automatic review settings August 24, 2026 20:10

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Database.Format escapes %s arguments automatically, so the manual
escape-into-buffer step before FormatEx is no longer needed. Retype
g_hDatabase as Database (it was already used as such via SQL_TQuery)
so the methodmap is available.
@Rushaway
Rushaway force-pushed the fix/sql-format-escaping branch from 5ea725c to 1372597 Compare August 27, 2026 06:36
@Rushaway
Rushaway merged commit c479cf6 into master Aug 27, 2026
6 checks passed
@Rushaway
Rushaway deleted the fix/sql-format-escaping branch August 27, 2026 06:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants