Skip to content

Is it possible to sniff a custom wpdb extension? #2482

Closed Answered by jrfnl
nosilver4u asked this question in Q&A
Discussion options

You must be logged in to vote

@nosilver4u This is currently not possible and I'm not sure it would be a good idea to allow for this. The sniffs which look for the $wpdb variable are mostly security related sniffs.

If any variable would be allowed (even if specifically "allow listed" from a ruleset), all presumptions the sniff makes based on the use of an WPDB object become invalid.

  • The variable may not be object, but may, for instance, be an array of objects.
  • Even if it is an object, does the class extend wpdb ?
  • Even if it does, are any of the security related methods the sniff looks for overloaded ? And if so, are they still secure ?

You see what I'm getting at ?

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@nosilver4u
Comment options

Answer selected by nosilver4u
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants