Make WordPress Core

Ticket #32937: 32937.diff

File 32937.diff, 999 bytes (added by boonebgorges, 9 years ago)
  • src/wp-includes/class-wp-meta-query.php

    diff --git src/wp-includes/class-wp-meta-query.php src/wp-includes/class-wp-meta-query.php
    index fbe49f3..e1fd812 100644
    class WP_Meta_Query { 
    548548                $meta_type  = $this->get_cast_for_type( $_meta_type );
    549549                $clause['cast'] = $meta_type;
    550550
    551                 // Fallback for clause keys is the table alias.
    552                 if ( ! $clause_key ) {
     551                // Fallback for clause keys is the table alias. Key must be a string.
     552                if ( is_int( $clause_key ) || ! $clause_key ) {
    553553                        $clause_key = $clause['alias'];
    554554                }
    555555
  • src/wp-includes/query.php

    diff --git src/wp-includes/query.php src/wp-includes/query.php
    index b08d2df..f0bfdf5 100644
    class WP_Query { 
    22712271                        $allowed_keys   = array_merge( $allowed_keys, array_keys( $meta_clauses ) );
    22722272                }
    22732273
    2274                 if ( ! in_array( $orderby, $allowed_keys ) ) {
     2274                if ( ! in_array( $orderby, $allowed_keys, true ) ) {
    22752275                        return false;
    22762276                }
    22772277