Init array in wpdb:get_results() and get_col_info(). Props UnderWordPressure, miqrogroove, fixes #10607
git-svn-id: https://develop.svn.wordpress.org/trunk@13161 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
966c84021f
commit
343b2b1251
@ -1059,6 +1059,7 @@ class wpdb {
|
|||||||
else
|
else
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
|
$new_array = array();
|
||||||
if ( $output == OBJECT ) {
|
if ( $output == OBJECT ) {
|
||||||
// Return an integer-keyed array of row objects
|
// Return an integer-keyed array of row objects
|
||||||
return $this->last_result;
|
return $this->last_result;
|
||||||
@ -1103,6 +1104,7 @@ class wpdb {
|
|||||||
if ( $this->col_info ) {
|
if ( $this->col_info ) {
|
||||||
if ( $col_offset == -1 ) {
|
if ( $col_offset == -1 ) {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
|
$new_array = array();
|
||||||
foreach( (array) $this->col_info as $col ) {
|
foreach( (array) $this->col_info as $col ) {
|
||||||
$new_array[$i] = $col->{$info_type};
|
$new_array[$i] = $col->{$info_type};
|
||||||
$i++;
|
$i++;
|
||||||
@ -1173,8 +1175,7 @@ class wpdb {
|
|||||||
*
|
*
|
||||||
* @return WP_Error
|
* @return WP_Error
|
||||||
*/
|
*/
|
||||||
function check_database_version()
|
function check_database_version() {
|
||||||
{
|
|
||||||
global $wp_version, $required_mysql_version;
|
global $wp_version, $required_mysql_version;
|
||||||
// Make sure the server has the required MySQL version
|
// Make sure the server has the required MySQL version
|
||||||
if ( version_compare($this->db_version(), $required_mysql_version, '<') )
|
if ( version_compare($this->db_version(), $required_mysql_version, '<') )
|
||||||
|
Loading…
Reference in New Issue
Block a user