Skip to content

DB/PreparedSQLPlaceholders: fix false negative when checking quotes in dynamic generated placeholders - #2569

Merged
dingo-d merged 1 commit into
WordPress:developfrom
rodrigoprimo:prepared-sql-placeholders-false-negative
Aug 8, 2025
Merged

dingo-d merged 1 commit into
WordPress:developfrom
rodrigoprimo:prepared-sql-placeholders-false-negative

Conversation

@rodrigoprimo

Copy link
Copy Markdown
Contributor

While working on preparing WPCS for the changes in PHPCS 4.0, more specifically the changes around namespace tokenization, I noticed that the WordPress.DB.PreparedSQLPlaceholders sniff was not accounting for fully qualified calls to implode() in the code that checks for quotes in dynamically generated placeholders. This PR fixes that. See the modified test for an example of a code that would cause a false negative.

…n dynamic generated placeholders

The sniff was not accounting for fully qualified calls to `implode()` in the code that checks for quotes in dynamically generated placeholders.

@jrfnl jrfnl left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good catch! LGTM.

@jrfnl jrfnl added this to the 3.2.x milestone Aug 8, 2025
@dingo-d
dingo-d merged commit cc56685 into WordPress:develop Aug 8, 2025
@rodrigoprimo
rodrigoprimo deleted the prepared-sql-placeholders-false-negative branch August 8, 2025 11:46
@jrfnl jrfnl modified the milestones: 3.2.x, 3.3.0 Sep 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants