Make WordPress Core

Ticket #27231: 27231.diff

File 27231.diff, 1.1 KB (added by nacin, 11 years ago)
  • src/wp-includes/wp-db.php

     
    1717/**
    1818 * @since 0.71
    1919 */
    20 define( 'OBJECT', 'OBJECT', true );
     20define( 'OBJECT', 'OBJECT' );
    2121
    2222/**
    2323 * @since 2.5.0
     
    18211821                        return $this->last_result[$y] ? get_object_vars( $this->last_result[$y] ) : null;
    18221822                } elseif ( $output == ARRAY_N ) {
    18231823                        return $this->last_result[$y] ? array_values( get_object_vars( $this->last_result[$y] ) ) : null;
     1824                } elseif ( strtoupper( $output ) === OBJECT ) {
     1825                        // Back compat for OBJECT being previously case insensitive.
     1826                        return $this->last_result[$y] ? $this->last_result[$y] : null;
    18241827                } else {
    18251828                        $this->print_error( " \$db->get_row(string query, output type, int offset) -- Output type must be one of: OBJECT, ARRAY_A, ARRAY_N" );
    18261829                }
     
    19001903                                }
    19011904                        }
    19021905                        return $new_array;
     1906                } elseif ( strtoupper( $output ) === OBJECT ) {
     1907                        // Back compat for OBJECT being previously case insensitive.
     1908                        return $this->last_result;
    19031909                }
    19041910                return null;
    19051911        }