Skip to content

fix: use Database.Format for SQL escaping instead of manual EscapeString - #8

Open
Rushaway wants to merge 1 commit into
masterfrom
fix/sql-format-escaping
Open

fix: use Database.Format for SQL escaping instead of manual EscapeString#8
Rushaway wants to merge 1 commit into
masterfrom
fix/sql-format-escaping

Conversation

@Rushaway

Copy link
Copy Markdown
Member

Summary

  • In player_manager.sp, the queries were already built with h_db.Format, which already escaped %s arguments; remove the now-redundant EscapeString(...) call into a separate buffer beforehand and pass the raw player name straight to Format.
  • Bump SHOP_VERSION (3.0E9 -> 3.0E10).

Why

Database.Format escapes string arguments on its own, so pre-escaping into a buffer before calling it does nothing useful and adds an extra driver touchpoint. The public EscapeString/DB_EscapeString API used by other Shop_* plugins is untouched.

Test plan

  • Compile plugin and confirm no errors
  • Connect with a Steam name containing quotes and confirm player row insert/update still works

h_db.Format was already used to build these queries, so the preceding
EscapeString call into a separate buffer was redundant; pass the raw
value straight to Format instead, which escapes %s arguments directly.
Copilot AI lite review requested due to automatic review settings August 24, 2026 20:08

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.

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