Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accessing $wpdb's public vars is is flagged as a database query #178

Closed
JDGrimes opened this issue Jun 25, 2014 · 5 comments · Fixed by #206
Closed

Accessing $wpdb's public vars is is flagged as a database query #178

JDGrimes opened this issue Jun 25, 2014 · 5 comments · Fixed by #206
Milestone

Comments

@JDGrimes
Copy link
Contributor

For example:

$site_id = $wpdb->siteid

This was unexpected.

@westonruter
Copy link
Member

Agreed. It needs to only flag the use of the methods off of $wpdb.

@JDGrimes
Copy link
Contributor Author

Agreed. It needs to only flag the use of the methods off of $wpdb.

Perhaps some methods should be whitelisted though. E.g., $wpdb->get_blog_prefix(). Although, why would anyone need to use that unless they are going to make a direct query...

@Rarst
Copy link
Contributor

Rarst commented Jun 26, 2014

$wpdb->show_errors() too.

@shadyvb
Copy link
Contributor

shadyvb commented Jul 12, 2014

@JDGrimes get_blog_prefix can be used to get user roles of a subsite, a single usage without a direct db query that i can think of.

Anyway, this has been handled by #206

@JDGrimes
Copy link
Contributor Author

JDGrimes commented Feb 7, 2015

The PR was merged and released in 0.3.0. So I guess this is fixed.

@JDGrimes JDGrimes closed this as completed Feb 7, 2015
@jrfnl jrfnl added this to the 0.3.0 milestone Jul 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
6 participants