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:
Andrew Nacin 2010-02-15 10:00:39 +00:00
parent 966c84021f
commit 343b2b1251
1 changed files with 3 additions and 2 deletions

View File

@ -1059,6 +1059,7 @@ class wpdb {
else
return null;
$new_array = array();
if ( $output == OBJECT ) {
// Return an integer-keyed array of row objects
return $this->last_result;
@ -1103,6 +1104,7 @@ class wpdb {
if ( $this->col_info ) {
if ( $col_offset == -1 ) {
$i = 0;
$new_array = array();
foreach( (array) $this->col_info as $col ) {
$new_array[$i] = $col->{$info_type};
$i++;
@ -1173,8 +1175,7 @@ class wpdb {
*
* @return WP_Error
*/
function check_database_version()
{
function check_database_version() {
global $wp_version, $required_mysql_version;
// Make sure the server has the required MySQL version
if ( version_compare($this->db_version(), $required_mysql_version, '<') )