diff --git a/src/wp-includes/class-wpdb.php b/src/wp-includes/class-wpdb.php
index d9186b91f4..a9f694e6d4 100644
a
|
b
|
class wpdb { |
2593 | 2593 | return false; |
2594 | 2594 | } |
2595 | 2595 | |
2596 | | $formats = array(); |
2597 | | $values = array(); |
2598 | | foreach ( $data as $value ) { |
| 2596 | $formats = array(); |
| 2597 | $values = array(); |
| 2598 | $identifiers = array(); |
| 2599 | foreach ( $data as $identifier => $value ) { |
2599 | 2600 | if ( is_null( $value['value'] ) ) { |
2600 | 2601 | $formats[] = 'NULL'; |
2601 | 2602 | continue; |
2602 | 2603 | } |
2603 | 2604 | |
2604 | | $formats[] = $value['format']; |
2605 | | $values[] = $value['value']; |
| 2605 | $formats[] = $value['format']; |
| 2606 | $identifiers[] = $identifier; |
| 2607 | $values[] = $value['value']; |
2606 | 2608 | } |
2607 | 2609 | |
2608 | | $fields = '`' . implode( '`, `', array_keys( $data ) ) . '`'; |
| 2610 | $fields = implode( ', ', array_fill( 0, count( $identifiers ), '%i' ) ); |
2609 | 2611 | $formats = implode( ', ', $formats ); |
2610 | 2612 | |
2611 | | $sql = "$type INTO `$table` ($fields) VALUES ($formats)"; |
| 2613 | $sql = "$type INTO %i ($fields) VALUES ($formats)"; |
| 2614 | $prepared = array_merge( array( $table ), $identifiers, $values ); |
2612 | 2615 | |
2613 | 2616 | $this->check_current_query = false; |
2614 | | return $this->query( $this->prepare( $sql, $values ) ); |
| 2617 | return $this->query( $this->prepare( $sql, $prepared ) ); |
2615 | 2618 | } |
2616 | 2619 | |
2617 | 2620 | /** |