Changeset 48981
- Timestamp:
- 09/16/2020 02:27:42 AM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/wp-db.php
r48980 r48981 1370 1370 $placeholders = preg_match_all( "/(^|[^%]|(%%)+)%($allowed_format)?[sdF]/", $query, $matches ); 1371 1371 1372 if ( count( $args ) !== $placeholders ) { 1372 $args_count = count( $args ); 1373 1374 if ( $args_count !== $placeholders ) { 1373 1375 if ( 1 === $placeholders && $passed_as_array ) { 1374 1376 // If the passed query only expected one argument, but the wrong number of arguments were sent as an array, bail. … … 1393 1395 __( 'The query does not contain the correct number of placeholders (%1$d) for the number of arguments passed (%2$d).' ), 1394 1396 $placeholders, 1395 count( $args )1397 $args_count 1396 1398 ), 1397 1399 '4.8.3' 1398 1400 ); 1401 1402 /* 1403 * If we don't have enough arguments to match the placeholders, 1404 * return an empty string to avoid a fatal error on PHP 8. 1405 */ 1406 if ( $args_count < $placeholders ) { 1407 $max_numbered_placeholder = ! empty( $matches[3] ) ? max( array_map( 'intval', $matches[3] ) ) : 0; 1408 1409 if ( ! $max_numbered_placeholder || $args_count < $max_numbered_placeholder ) { 1410 return ''; 1411 } 1412 } 1399 1413 } 1400 1414 }
Note: See TracChangeset
for help on using the changeset viewer.