WordPress.org

Make WordPress Core

Changeset 28737


Ignore:
Timestamp:
06/11/2014 05:49:07 PM (6 years ago)
Author:
wonderboymusic
Message:

Don't use variable variables in WP_Query::get_posts().

See #27881.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/query.php

    r28712 r28737  
    30833083            $clauses = (array) apply_filters_ref_array( 'posts_clauses', array( compact( $pieces ), &$this ) );
    30843084
    3085             foreach ( $pieces as $piece ) {
    3086                 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
    3087             }
     3085            $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
     3086            $groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
     3087            $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
     3088            $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
     3089            $distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
     3090            $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
     3091            $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
    30883092        }
    30893093
     
    32023206             */
    32033207            $clauses = (array) apply_filters_ref_array( 'posts_clauses_request', array( compact( $pieces ), &$this ) );
    3204             foreach ( $pieces as $piece )
    3205                 $$piece = isset( $clauses[ $piece ] ) ? $clauses[ $piece ] : '';
     3208
     3209            $where = isset( $clauses[ 'where' ] ) ? $clauses[ 'where' ] : '';
     3210            $groupby = isset( $clauses[ 'groupby' ] ) ? $clauses[ 'groupby' ] : '';
     3211            $join = isset( $clauses[ 'join' ] ) ? $clauses[ 'join' ] : '';
     3212            $orderby = isset( $clauses[ 'orderby' ] ) ? $clauses[ 'orderby' ] : '';
     3213            $distinct = isset( $clauses[ 'distinct' ] ) ? $clauses[ 'distinct' ] : '';
     3214            $fields = isset( $clauses[ 'fields' ] ) ? $clauses[ 'fields' ] : '';
     3215            $limits = isset( $clauses[ 'limits' ] ) ? $clauses[ 'limits' ] : '';
    32063216        }
    32073217
Note: See TracChangeset for help on using the changeset viewer.