Changeset 44272 for trunk/src/wp-includes/wp-db.php
- Timestamp:
- 12/17/2018 06:38:13 PM (7 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/5.0 merged: 43934
- Property svn:mergeinfo changed
-
trunk/src/wp-includes/wp-db.php
r43571 r44272 2545 2545 $new_array = array(); 2546 2546 // Extract the column values 2547 for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) { 2548 $new_array[ $i ] = $this->get_var( null, $x, $i ); 2547 if ( $this->last_result ) { 2548 for ( $i = 0, $j = count( $this->last_result ); $i < $j; $i++ ) { 2549 $new_array[ $i ] = $this->get_var( null, $x, $i ); 2550 } 2549 2551 } 2550 2552 return $new_array; … … 2586 2588 // Return an array of row objects with keys from column 1 2587 2589 // (Duplicates are discarded) 2588 foreach ( $this->last_result as $row ) { 2589 $var_by_ref = get_object_vars( $row ); 2590 $key = array_shift( $var_by_ref ); 2591 if ( ! isset( $new_array[ $key ] ) ) { 2592 $new_array[ $key ] = $row; 2590 if ( $this->last_result ) { 2591 foreach ( $this->last_result as $row ) { 2592 $var_by_ref = get_object_vars( $row ); 2593 $key = array_shift( $var_by_ref ); 2594 if ( ! isset( $new_array[ $key ] ) ) { 2595 $new_array[ $key ] = $row; 2596 } 2593 2597 } 2594 2598 }
Note: See TracChangeset
for help on using the changeset viewer.