Changeset 43934 for branches/5.0/src/wp-includes/wp-db.php
- Timestamp:
- 11/22/2018 03:58:19 AM (8 years ago)
- File:
-
- 1 edited
-
branches/5.0/src/wp-includes/wp-db.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/5.0/src/wp-includes/wp-db.php
r42550 r43934 2457 2457 $new_array = array(); 2458 2458 // Extract the column values 2459 for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) { 2460 $new_array[$i] = $this->get_var( null, $x, $i ); 2459 if ( $this->last_result ) { 2460 for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) { 2461 $new_array[ $i ] = $this->get_var( null, $x, $i ); 2462 } 2461 2463 } 2462 2464 return $new_array; … … 2498 2500 // Return an array of row objects with keys from column 1 2499 2501 // (Duplicates are discarded) 2500 foreach ( $this->last_result as $row ) { 2501 $var_by_ref = get_object_vars( $row ); 2502 $key = array_shift( $var_by_ref ); 2503 if ( ! isset( $new_array[ $key ] ) ) 2504 $new_array[ $key ] = $row; 2502 if ( $this->last_result ) { 2503 foreach ( $this->last_result as $row ) { 2504 $var_by_ref = get_object_vars( $row ); 2505 $key = array_shift( $var_by_ref ); 2506 if ( ! isset( $new_array[ $key ] ) ) { 2507 $new_array[ $key ] = $row; 2508 } 2509 } 2505 2510 } 2506 2511 return $new_array;
Note: See TracChangeset
for help on using the changeset viewer.