WP 3.5 : Missing argument 2 for wpdb::prepare
-
Hi,
I got the following error message in the “settings” tab of STT2 since wordpress 3.5 upgrade :
Warning: Missing argument 2 for wpdb::prepare(), called in /home/(…)wp-content/plugins/searchterms-tagging-2/searchterms-tagging2.php on line 658 and defined in /home/(…)/wp-includes/wp-db.php on line 990
There is another similar error about line 695 in the same file. I guess you (STT2 users) all see this error since wp 3.5.
Googling the error message led me to this page : apparently nothing is broken, but there might be a risk of SQL injection with STT2 plugin. Since it seems that the developer is not around anymore, can someone more savvy give some advice about it ?
I noticed that replacing on line 658 :
$post_count = $wpdb->get_var($wpdb->prepare( $sql ));
by a direct query
$post_count = $wpdb->query( $sql );
… removes the first warning, and that adding a dummy argument in the query on line 695 removes the other one while keeping everything functional …
$post_count = $wpdb->get_var($wpdb->prepare( $sql, $id));
… but this is pure speculation as I do not understand exactly why WordPress now throws this error message in the first place ??
Any comment would be appreciated!
Thank you,Cyril
https://www.ads-software.com/extend/plugins/searchterms-tagging-2/
- The topic ‘WP 3.5 : Missing argument 2 for wpdb::prepare’ is closed to new replies.