Init array in wpdb:get_results() and get_col_info(). Props UnderWordPressure, miqrogroove, fixes #10607
git-svn-id: http://svn.automattic.com/wordpress/trunk@13161 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6597e399cc
commit
02834b7206
|
@ -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