Changeset 41663
- Timestamp:
- 10/02/2017 02:44:48 AM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r41662 r41663 1231 1231 // This is not meant to be foolproof -- but it will catch obviously incorrect usage. 1232 1232 if ( strpos( $query, '%' ) === false ) { 1233 wp_load_translations_early(); 1233 1234 _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'The query argument of %s must have a placeholder.' ), 'wpdb::prepare()' ), '3.9.0' ); 1234 1235 } … … 1244 1245 foreach ( $args as $arg ) { 1245 1246 if ( ! is_scalar( $arg ) && ! is_null( $arg ) ) { 1247 wp_load_translations_early(); 1246 1248 _doing_it_wrong( 'wpdb::prepare', sprintf( __( 'Unsupported value type (%s).' ), gettype( $arg ) ), '4.8.2' ); 1247 1249 } … … 1255 1257 1256 1258 // Count the number of valid placeholders in the query 1257 $placeholders = preg_match_all( '/(^|[^%]|(%%)+)%[sdF]/', $query );1259 $placeholders = preg_match_all( '/(^|[^%]|(%%)+)%[sdF]/', $query, $matches ); 1258 1260 1259 1261 if ( count ( $args ) !== $placeholders ) { 1262 wp_load_translations_early(); 1260 1263 _doing_it_wrong( 'wpdb::prepare', 1261 1264 sprintf( __( 'The query does not contain the correct number of placeholders (%d) for the number of arguments passed (%d).' ),
Note: See TracChangeset
for help on using the changeset viewer.